hive-intelligence 1.7.3 → 1.9.0

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.
@@ -19461,8 +19461,15 @@ var DeFiLlamaAPI = class {
19461
19461
  async getPriceChart(coins, start, span, period, searchWidth, end) {
19462
19462
  const endpoint = `/chart/${encodeURIComponent(coins)}`;
19463
19463
  const params = {};
19464
+ const bounded = Boolean(start && end && end > start);
19465
+ if (bounded && !span) {
19466
+ span = Math.min(
19467
+ Math.ceil((end - start) / chartPeriodSeconds(period)) + 1,
19468
+ 500
19469
+ );
19470
+ }
19464
19471
  if (start) params.start = start;
19465
- if (end) params.end = end;
19472
+ if (end && !start) params.end = end;
19466
19473
  if (span) params.span = span;
19467
19474
  if (period) params.period = period;
19468
19475
  if (searchWidth) params.searchWidth = searchWidth;
@@ -19473,10 +19480,13 @@ var DeFiLlamaAPI = class {
19473
19480
  for (const [coin, coinData] of Object.entries(data.coins)) {
19474
19481
  const typedCoinData = coinData;
19475
19482
  if (typedCoinData.prices && Array.isArray(typedCoinData.prices)) {
19483
+ const inRange = bounded ? typedCoinData.prices.filter(
19484
+ (point) => typeof point.timestamp !== "number" || point.timestamp <= end
19485
+ ) : typedCoinData.prices;
19476
19486
  limitedData.coins[coin] = {
19477
19487
  ...typedCoinData,
19478
- prices: typedCoinData.prices.slice(-100),
19479
- originalPriceCount: typedCoinData.prices.length
19488
+ prices: inRange.slice(-100),
19489
+ originalPriceCount: inRange.length
19480
19490
  };
19481
19491
  } else {
19482
19492
  limitedData.coins[coin] = typedCoinData;
@@ -19806,6 +19816,12 @@ var DeFiLlamaAPI = class {
19806
19816
  return data;
19807
19817
  }
19808
19818
  };
19819
+ function chartPeriodSeconds(period) {
19820
+ const match = /^(\d+)\s*([mhdw])$/i.exec((period ?? "").trim());
19821
+ if (!match) return 86400;
19822
+ const unit = { m: 60, h: 3600, d: 86400, w: 604800 };
19823
+ return Math.max(Number(match[1]), 1) * unit[match[2].toLowerCase()];
19824
+ }
19809
19825
 
19810
19826
  // src/tools/defillamaTools/tools/categories/protocols.ts
19811
19827
  function protocolsTools(apiClient) {
@@ -26777,7 +26793,14 @@ function classifyRuntimeStatusFromError(error) {
26777
26793
  normalized.includes("unknown chain") || // Provider-side rejections of a malformed identifier (GoPlus "Address
26778
26794
  // format error!", "invalid address", "not a valid address") are the
26779
26795
  // caller's to fix, not an outage (2026-09-16 audit).
26780
- normalized.includes("address format") || normalized.includes("invalid address") || normalized.includes("not a valid address") || normalized.includes("malformed address")) {
26796
+ normalized.includes("address format") || normalized.includes("invalid address") || normalized.includes("not a valid address") || normalized.includes("malformed address") || // 2026-09-24 sweep: upstream bodies the HTTP client now surfaces. Helius
26797
+ // "Invalid wallet address ... is not a valid Solana address", DAS "Pubkey
26798
+ // Validation Err", GoPlus 7012 "Not fungible spl token address", Alchemy
26799
+ // "invalid 1st argument", and a simulated transaction that reverts.
26800
+ /\binvalid [a-z ]{0,24}address\b/.test(normalized) || /\bnot a valid [a-z ]{0,24}address\b/.test(normalized) || normalized.includes("pubkey validation") || normalized.includes("invalid pubkey") || normalized.includes("not fungible") || /\binvalid \d+(st|nd|rd|th) argument\b/.test(normalized) || normalized.includes("execution reverted") || // Tenderly gateway: -32006 "Bad request input parameters".
26801
+ normalized.includes("bad request input") || // An upstream 404 that says the id or address does not exist. A bare
26802
+ // "status code 404" with no body stays failing: it may be our own route.
26803
+ /\b404\b/.test(normalized) && normalized.includes("not found")) {
26781
26804
  return "invalid_input";
26782
26805
  }
26783
26806
  if (normalized.includes("timed out") || normalized.includes("timeout") || normalized.includes("temporarily") || normalized.includes("service unavailable") || normalized.includes("502") || normalized.includes("503") || normalized.includes("504")) {
@@ -30937,16 +30960,35 @@ function getCircuitBreaker(serviceName) {
30937
30960
  }
30938
30961
  return circuitBreakers.get(serviceName);
30939
30962
  }
30963
+ function upstreamDetail(error) {
30964
+ const data = error.response?.data;
30965
+ const text = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
30966
+ let detail;
30967
+ if (typeof data === "string") {
30968
+ detail = text(data.replace(/<[^>]*>/g, " "));
30969
+ } else if (data && typeof data === "object") {
30970
+ const body = data;
30971
+ const nested = body.error && typeof body.error === "object" ? text(body.error.message) : void 0;
30972
+ const primary = text(body.message) ?? text(body.error) ?? nested ?? text(body.error_message) ?? text(body.status?.error_message) ?? text(body.msg);
30973
+ const details = text(body.details);
30974
+ detail = primary && details && !primary.includes(details) ? `${primary} (${details})` : primary ?? details;
30975
+ }
30976
+ if (!detail) return null;
30977
+ const compact = detail.replace(/\s+/g, " ").trim();
30978
+ return compact ? compact.slice(0, 240) : null;
30979
+ }
30980
+ function withUpstreamDetail(error) {
30981
+ if (!(error instanceof AxiosError)) return error;
30982
+ const detail = upstreamDetail(error);
30983
+ if (detail && !error.message.includes(detail)) {
30984
+ error.message = `${error.message}: ${detail}`;
30985
+ }
30986
+ return error;
30987
+ }
30940
30988
  function failureMessage(error) {
30941
30989
  let message = "";
30942
30990
  if (error instanceof AxiosError) {
30943
- const data = error.response?.data;
30944
- const fromBody = [
30945
- data?.message,
30946
- data?.error,
30947
- data?.status?.error_message
30948
- ].find((value) => typeof value === "string" && value.trim());
30949
- message = typeof fromBody === "string" ? fromBody : error.message;
30991
+ message = upstreamDetail(error) ?? error.message;
30950
30992
  } else if (error instanceof Error) {
30951
30993
  message = error.message;
30952
30994
  } else if (error) {
@@ -31159,7 +31201,7 @@ var ResilientHttpClient = class {
31159
31201
  break;
31160
31202
  }
31161
31203
  }
31162
- throw lastError;
31204
+ throw withUpstreamDetail(lastError);
31163
31205
  }
31164
31206
  /**
31165
31207
  * Perform a GET request
@@ -31243,6 +31285,39 @@ function createHttpClient(config2) {
31243
31285
  }
31244
31286
 
31245
31287
  // src/tools/tenderly/tenderlyClient.ts
31288
+ var GATEWAY_MAX_IN_FLIGHT = 2;
31289
+ var GATEWAY_MAX_ATTEMPTS = 4;
31290
+ var gatewayInFlight = 0;
31291
+ var gatewayWaiters = [];
31292
+ async function withGatewaySlot(task) {
31293
+ if (gatewayInFlight >= GATEWAY_MAX_IN_FLIGHT) {
31294
+ await new Promise((resolve) => gatewayWaiters.push(resolve));
31295
+ }
31296
+ gatewayInFlight++;
31297
+ try {
31298
+ return await task();
31299
+ } finally {
31300
+ gatewayInFlight--;
31301
+ gatewayWaiters.shift()?.();
31302
+ }
31303
+ }
31304
+ function gatewayRetryDelayMs(attempt, retryAfter) {
31305
+ const seconds = Number(retryAfter);
31306
+ if (Number.isFinite(seconds) && seconds > 0) {
31307
+ return Math.min(seconds * 1e3, 5e3);
31308
+ }
31309
+ return 1e3 * 2 ** (attempt - 1) + Math.random() * 250;
31310
+ }
31311
+ function gatewayErrorDetail(bodyText) {
31312
+ try {
31313
+ const parsed = JSON.parse(bodyText);
31314
+ const message = parsed?.error?.message;
31315
+ return typeof message === "string" && message.trim() ? `: ${message.trim()}` : "";
31316
+ } catch {
31317
+ const compact = bodyText.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
31318
+ return compact ? `: ${compact.slice(0, 200)}` : "";
31319
+ }
31320
+ }
31246
31321
  var TenderlyClient = class {
31247
31322
  httpClient;
31248
31323
  apiKey;
@@ -31428,17 +31503,37 @@ var TenderlyClient = class {
31428
31503
  params
31429
31504
  };
31430
31505
  try {
31431
- const response = await fetch(url, {
31432
- method: "POST",
31433
- headers: { "Content-Type": "application/json" },
31434
- body: JSON.stringify(body),
31435
- signal: AbortSignal.timeout(3e4)
31506
+ const response = await withGatewaySlot(async () => {
31507
+ for (let attempt = 1; ; attempt++) {
31508
+ const attemptResponse = await fetch(url, {
31509
+ method: "POST",
31510
+ headers: { "Content-Type": "application/json" },
31511
+ body: JSON.stringify(body),
31512
+ signal: AbortSignal.timeout(3e4)
31513
+ });
31514
+ if (attemptResponse.ok) return attemptResponse;
31515
+ const retryable = attemptResponse.status === 429 || attemptResponse.status >= 500;
31516
+ if (retryable && attempt < GATEWAY_MAX_ATTEMPTS) {
31517
+ await attemptResponse.body?.cancel().catch(() => void 0);
31518
+ await new Promise(
31519
+ (resolve) => setTimeout(
31520
+ resolve,
31521
+ gatewayRetryDelayMs(
31522
+ attempt,
31523
+ attemptResponse.headers.get("retry-after")
31524
+ )
31525
+ )
31526
+ );
31527
+ continue;
31528
+ }
31529
+ const detail = gatewayErrorDetail(
31530
+ await attemptResponse.text().catch(() => "")
31531
+ );
31532
+ throw new Error(
31533
+ `Gateway RPC error: ${attemptResponse.status} ${attemptResponse.statusText}${detail}`
31534
+ );
31535
+ }
31436
31536
  });
31437
- if (!response.ok) {
31438
- throw new Error(
31439
- `Gateway RPC error: ${response.status} ${response.statusText}`
31440
- );
31441
- }
31442
31537
  const json = await response.json();
31443
31538
  if (json.error) {
31444
31539
  throw new Error(`RPC error ${json.error.code}: ${json.error.message}`);
@@ -32608,7 +32703,9 @@ var gatewayDefinitions = [
32608
32703
  makeGatewayTool(
32609
32704
  "suggestGasFee",
32610
32705
  "tenderly_suggest_gas_fee",
32611
- "suggestGasFee",
32706
+ // The gateway method is plural; "suggestGasFee" answers "method not
32707
+ // found" (2026-09-24 sweep).
32708
+ "suggestGasFees",
32612
32709
  "Get EIP-1559 max-fee and priority-fee suggestions with estimated inclusion times.",
32613
32710
  {},
32614
32711
  [],
@@ -43819,7 +43916,7 @@ var AlchemyClient = class {
43819
43916
  apiPath(path) {
43820
43917
  return path.replace("{apiKey}", encodeURIComponent(this.apiKey));
43821
43918
  }
43822
- async rpc(network, method, params = []) {
43919
+ async rpc(network, method, params = [], options = {}) {
43823
43920
  const startTime = Date.now();
43824
43921
  const client2 = this.getHttpClient(
43825
43922
  `https://${network}.g.alchemy.com`,
@@ -43834,7 +43931,7 @@ var AlchemyClient = class {
43834
43931
  try {
43835
43932
  const response = await client2.post(
43836
43933
  `/v2/${encodeURIComponent(this.apiKey)}`,
43837
- { body }
43934
+ { body, ...options }
43838
43935
  );
43839
43936
  if (response.error) {
43840
43937
  secureLogger.toolCall(`AlchemyRPC:${method}`, false, Date.now() - startTime, {
@@ -44226,46 +44323,146 @@ function rpcTool(key, name, description, method, properties, paramsBuilder, requ
44226
44323
  }
44227
44324
  };
44228
44325
  }
44326
+ var HELIUS_DAS_METHODS = {
44327
+ getAssets: "getAssetBatch",
44328
+ getAssetProofs: "getAssetProofBatch",
44329
+ getAssetSignatures: "getSignaturesForAsset"
44330
+ };
44331
+ var HELIUS_DAS_PARAM_RENAMES = {
44332
+ getNftEditions: { mintAddress: "mint" },
44333
+ getTokenAccounts: { ownerAddress: "owner", mintAddress: "mint" }
44334
+ };
44335
+ var ALCHEMY_SOLANA_INDEXER_TIMEOUT_MS = 6e3;
44336
+ var heliusFallbackClient = null;
44337
+ function getHeliusFallbackClient() {
44338
+ if (!heliusFallbackClient && process.env.HELIUS_API_KEY) {
44339
+ heliusFallbackClient = new HeliusClient(process.env.HELIUS_API_KEY);
44340
+ }
44341
+ return heliusFallbackClient;
44342
+ }
44343
+ function toHeliusRequest(method, params) {
44344
+ const renames = HELIUS_DAS_PARAM_RENAMES[method];
44345
+ const renamed = renames && params && typeof params === "object" && !Array.isArray(params) ? Object.fromEntries(
44346
+ Object.entries(params).map(
44347
+ ([key, value]) => [renames[key] ?? key, value]
44348
+ )
44349
+ ) : params;
44350
+ return { method: HELIUS_DAS_METHODS[method] ?? method, params: renamed };
44351
+ }
44352
+ function withSolanaIndexerFallback(definition, method, paramsBuilder) {
44353
+ const name = definition.tool.name;
44354
+ return {
44355
+ ...definition,
44356
+ handler: async (clientParam, args = {}) => {
44357
+ const network = String(args.network || "solana-mainnet");
44358
+ const helius2 = network === "solana-mainnet" ? getHeliusFallbackClient() : null;
44359
+ if (!helius2) return definition.handler(clientParam, args);
44360
+ let alchemyError = new Error("Alchemy API key not configured");
44361
+ const client2 = resolveClient4(clientParam);
44362
+ if (client2) {
44363
+ try {
44364
+ const result2 = await client2.rpc(network, method, paramsBuilder(args), {
44365
+ timeout: ALCHEMY_SOLANA_INDEXER_TIMEOUT_MS,
44366
+ skipRetry: true
44367
+ });
44368
+ return createSuccessResponse6(shapeRpcResult(name, network, result2));
44369
+ } catch (error) {
44370
+ const message = error instanceof Error ? error.message : String(error);
44371
+ if (classifyRuntimeStatusFromError(message) === "invalid_input") {
44372
+ return createErrorResponse6(
44373
+ error,
44374
+ name,
44375
+ "Check JSON-RPC params and network support.",
44376
+ args
44377
+ );
44378
+ }
44379
+ alchemyError = error;
44380
+ }
44381
+ }
44382
+ const request = toHeliusRequest(method, paramsBuilder(args));
44383
+ try {
44384
+ const result2 = await helius2.request(
44385
+ request.method,
44386
+ request.params
44387
+ );
44388
+ const reason = alchemyError instanceof Error ? alchemyError.message : String(alchemyError);
44389
+ const shaped = shapeRpcResult(name, network, result2);
44390
+ const payload = shaped && typeof shaped === "object" && !Array.isArray(shaped) ? { ...shaped } : { result: shaped };
44391
+ return {
44392
+ ...createSuccessResponse6({
44393
+ ...payload,
44394
+ _fallback: {
44395
+ provider: "Helius",
44396
+ method: request.method,
44397
+ reason: `Alchemy ${method} unavailable: ${reason.slice(0, 160)}`
44398
+ }
44399
+ }),
44400
+ _hiveExec: { source: "fallback", originSource: "fallback" }
44401
+ };
44402
+ } catch (heliusError) {
44403
+ const heliusMessage = heliusError instanceof Error ? heliusError.message : String(heliusError);
44404
+ const alchemyMessage = alchemyError instanceof Error ? alchemyError.message : String(alchemyError);
44405
+ return createErrorResponse6(
44406
+ new Error(
44407
+ `${alchemyMessage}; Helius fallback (${request.method}) also failed: ${heliusMessage}`
44408
+ ),
44409
+ name,
44410
+ "Check JSON-RPC params and network support.",
44411
+ args
44412
+ );
44413
+ }
44414
+ }
44415
+ };
44416
+ }
44229
44417
  function dasTool(key, name, description, method, properties, required = [], schemaExtensions = {}) {
44230
- return rpcTool(
44231
- key,
44232
- name,
44233
- `${description} Uses Alchemy's Solana Digital Asset Standard (DAS) API.`,
44234
- method,
44235
- {
44236
- network: {
44237
- type: "string",
44238
- enum: ["solana-mainnet", "solana-devnet"],
44239
- default: "solana-mainnet",
44240
- description: "Alchemy Solana network slug."
44418
+ const paramsBuilder = (args) => omitKeys(args, ["network"]);
44419
+ return withSolanaIndexerFallback(
44420
+ rpcTool(
44421
+ key,
44422
+ name,
44423
+ `${description} Uses Alchemy's Solana Digital Asset Standard (DAS) API, with Helius as the mainnet fallback.`,
44424
+ method,
44425
+ {
44426
+ network: {
44427
+ type: "string",
44428
+ enum: ["solana-mainnet", "solana-devnet"],
44429
+ default: "solana-mainnet",
44430
+ description: "Alchemy Solana network slug."
44431
+ },
44432
+ ...properties
44241
44433
  },
44242
- ...properties
44243
- },
44244
- (args) => omitKeys(args, ["network"]),
44245
- required,
44246
- { ...schemaExtensions, additionalProperties: false },
44247
- "solana-mainnet"
44434
+ paramsBuilder,
44435
+ required,
44436
+ { ...schemaExtensions, additionalProperties: false },
44437
+ "solana-mainnet"
44438
+ ),
44439
+ method,
44440
+ paramsBuilder
44248
44441
  );
44249
44442
  }
44250
44443
  function photonTool(key, name, description, method, properties, paramsBuilder, required = [], schemaExtensions = {}) {
44251
- return rpcTool(
44252
- key,
44253
- name,
44254
- `${description} Uses Alchemy's Solana Photon/ZK Compression indexer.`,
44255
- method,
44256
- {
44257
- network: {
44258
- type: "string",
44259
- enum: ["solana-mainnet", "solana-devnet"],
44260
- default: "solana-mainnet",
44261
- description: "Alchemy Solana network slug."
44444
+ return withSolanaIndexerFallback(
44445
+ rpcTool(
44446
+ key,
44447
+ name,
44448
+ `${description} Uses Alchemy's Solana Photon/ZK Compression indexer, with Helius as the mainnet fallback.`,
44449
+ method,
44450
+ {
44451
+ network: {
44452
+ type: "string",
44453
+ enum: ["solana-mainnet", "solana-devnet"],
44454
+ default: "solana-mainnet",
44455
+ description: "Alchemy Solana network slug."
44456
+ },
44457
+ ...properties
44262
44458
  },
44263
- ...properties
44264
- },
44265
- paramsBuilder,
44266
- required,
44267
- { ...schemaExtensions, additionalProperties: false },
44268
- "solana-mainnet"
44459
+ paramsBuilder,
44460
+ required,
44461
+ { ...schemaExtensions, additionalProperties: false },
44462
+ "solana-mainnet"
44463
+ ),
44464
+ method,
44465
+ paramsBuilder
44269
44466
  );
44270
44467
  }
44271
44468
  function requireExactlyOne(args, first, second) {
@@ -44865,8 +45062,16 @@ var definitions = [
44865
45062
  description: "Block context used for the simulation."
44866
45063
  }
44867
45064
  },
44868
- (args) => [args.format ?? "FLAT", args.transaction, args.blockTag ?? "latest"],
44869
- ["format", "transaction", "blockTag"]
45065
+ // Alchemy's positional order is [transaction, blockTag, { format }]. Sending
45066
+ // the format first made every call fail with "invalid 1st argument"
45067
+ // (2026-09-24 sweep); format and blockTag have defaults, so neither is
45068
+ // required.
45069
+ (args) => [
45070
+ args.transaction,
45071
+ args.blockTag ?? "latest",
45072
+ { format: args.format ?? "FLAT" }
45073
+ ],
45074
+ ["transaction"]
44870
45075
  ),
44871
45076
  rpcTool(
44872
45077
  "simulateAssetChangesBundle",
@@ -46235,6 +46440,42 @@ var HyperliquidAPI = class {
46235
46440
 
46236
46441
  // src/tools/hyperliquid/infoTools.ts
46237
46442
  var MAX_ARRAY_ITEMS = 500;
46443
+ var SPOT_TOKEN_TTL_MS = 10 * 60 * 1e3;
46444
+ var spotTokenCache = null;
46445
+ async function listSpotTokens(api) {
46446
+ if (spotTokenCache && Date.now() - spotTokenCache.at < SPOT_TOKEN_TTL_MS) {
46447
+ return spotTokenCache.tokens;
46448
+ }
46449
+ const meta2 = await api.info({ type: "spotMeta" });
46450
+ const tokens = (meta2?.tokens ?? []).flatMap(
46451
+ (token) => typeof token.name === "string" && typeof token.tokenId === "string" ? [
46452
+ {
46453
+ name: token.name,
46454
+ tokenId: token.tokenId,
46455
+ index: typeof token.index === "number" ? token.index : void 0
46456
+ }
46457
+ ] : []
46458
+ );
46459
+ spotTokenCache = { at: Date.now(), tokens };
46460
+ return tokens;
46461
+ }
46462
+ async function resolveSpotTokenId(value, api) {
46463
+ const raw = String(value).trim();
46464
+ let tokens;
46465
+ try {
46466
+ tokens = await listSpotTokens(api);
46467
+ } catch {
46468
+ return raw;
46469
+ }
46470
+ const lower = raw.toLowerCase();
46471
+ const match = tokens.find((token) => token.tokenId.toLowerCase() === lower) ?? tokens.find((token) => token.name.toLowerCase() === lower) ?? (/^\d+$/.test(raw) ? tokens.find((token) => token.index === Number(raw)) : void 0);
46472
+ if (!match) {
46473
+ throw new Error(
46474
+ `Invalid arguments: unknown Hyperliquid spot token '${raw}'. Pass a tokenId from hyperliquid_get_spot_meta tokens[].tokenId (USDC is 0x6d1e7cde53ba9467b783cb7c530ce054) or a spot token name such as "HYPE".`
46475
+ );
46476
+ }
46477
+ return match.tokenId;
46478
+ }
46238
46479
  var USER = {
46239
46480
  arg: "user",
46240
46481
  field: "user",
@@ -46738,8 +46979,9 @@ var HYPERLIQUID_INFO_DESCRIPTORS = [
46738
46979
  required: true,
46739
46980
  schema: {
46740
46981
  type: "string",
46741
- description: 'Token id in 34-character hexadecimal format (from hyperliquid_get_spot_meta tokens[].tokenId), e.g. "0x00000000000000000000000000000000".'
46742
- }
46982
+ description: 'Token id in 34-character hexadecimal format (from hyperliquid_get_spot_meta tokens[].tokenId), e.g. "0x6d1e7cde53ba9467b783cb7c530ce054" (USDC). A spot token name such as "HYPE" is also accepted.'
46983
+ },
46984
+ resolve: resolveSpotTokenId
46743
46985
  }
46744
46986
  ]
46745
46987
  },
@@ -47103,7 +47345,8 @@ function getHyperliquidInfoEndpoints(api) {
47103
47345
  }
47104
47346
  continue;
47105
47347
  }
47106
- body[param.field] = param.coerce ? param.coerce(raw) : raw;
47348
+ const coerced = param.coerce ? param.coerce(raw) : raw;
47349
+ body[param.field] = param.resolve ? await param.resolve(coerced, api) : coerced;
47107
47350
  }
47108
47351
  const data = await api.info(body);
47109
47352
  const transformed = descriptor.transform ? descriptor.transform(data) : data;
@@ -48786,7 +49029,14 @@ function getArchiveClient() {
48786
49029
  // src/tools/archive/api.ts
48787
49030
  var DEFAULT_LIMIT2 = 100;
48788
49031
  var MAX_LIMIT2 = 500;
48789
- var ARCHIVE_SINCE_NOTE = "archive since 2023-11";
49032
+ var ARCHIVE_SINCE = {
49033
+ funding: "2023-11",
49034
+ open_interest: "2025-04",
49035
+ basis: "2025-03",
49036
+ long_short: "2026-03",
49037
+ liquidations: "2025-04"
49038
+ };
49039
+ var ARCHIVE_SINCE_NOTE = `archive since ${ARCHIVE_SINCE.funding}`;
48790
49040
  var QUERY_TIMEOUT_MS = 1e4;
48791
49041
  var VENUE_SCAN_MAX_STEPS = 64;
48792
49042
  var COVERAGE_CACHE_TTL_MS = 10 * 60 * 1e3;
@@ -49080,7 +49330,7 @@ function historyHandler(toolName, dataset, options) {
49080
49330
  dataset: spec.table,
49081
49331
  runtime_status: "ok",
49082
49332
  fetched_at: (/* @__PURE__ */ new Date()).toISOString(),
49083
- note: options?.extraNote ? `${ARCHIVE_SINCE_NOTE}. ${options.extraNote}` : ARCHIVE_SINCE_NOTE,
49333
+ note: options?.extraNote ? `archive since ${ARCHIVE_SINCE[dataset]}. ${options.extraNote}` : `archive since ${ARCHIVE_SINCE[dataset]}`,
49084
49334
  filters,
49085
49335
  order: `${spec.tsColumn} desc`,
49086
49336
  returnedCount: mapped.length,
@@ -53889,7 +54139,7 @@ var PROVIDER_CATALOG = [
53889
54139
  id: "archive",
53890
54140
  name: "Hive Archive",
53891
54141
  prefix: "archive_",
53892
- type: "Cross-venue crypto derivatives history since 2023-11 (33 CEX+DEX venues): funding-rate settlements, open interest, basis, long/short ratio, and liquidations from Hive's own archive store",
54142
+ type: "Cross-venue crypto derivatives history from Hive's own archive store: funding-rate settlements across 33 CEX+DEX venues since 2023-11, basis since 2025-03, open interest and liquidations since 2025-04, and long/short ratio since 2026-03",
53893
54143
  clientStrategy: "internal",
53894
54144
  credentialRequirement: {
53895
54145
  label: "SHARPE_ARCHIVE_SUPABASE_URL and SHARPE_ARCHIVE_SUPABASE_SERVICE_ROLE_KEY",
@@ -54089,6 +54339,199 @@ function normalizeEndpointSchema(endpoint) {
54089
54339
  };
54090
54340
  }
54091
54341
 
54342
+ // src/config/retiredTools.ts
54343
+ var RETIRED_TOOLS_DATE = "2026-09-06";
54344
+ var RETIRED_TOOL_REPLACEMENTS = {
54345
+ // wallet
54346
+ codex_filter_wallets_by_network: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54347
+ codex_get_wallet_aggregate_backfill_state: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54348
+ codex_get_wallet_label_types: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54349
+ filter_network_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54350
+ filter_token_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54351
+ filter_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54352
+ get_wallet_balances: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54353
+ get_wallet_chart: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54354
+ get_wallet_stats: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54355
+ get_wallet_token_events: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
54356
+ // holders
54357
+ get_token_holders: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
54358
+ get_token_top_traders: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
54359
+ get_top_holders_percentage: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
54360
+ // pairs
54361
+ codex_get_detailed_token_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54362
+ codex_get_windowed_pair_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54363
+ filter_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54364
+ get_detailed_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54365
+ get_latest_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54366
+ get_liquidity_info: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54367
+ get_pair_chart_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54368
+ get_pair_info: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54369
+ get_pair_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54370
+ get_pairs_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54371
+ get_token_liquidity_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54372
+ get_token_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54373
+ get_token_pairs_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
54374
+ // charts
54375
+ codex_get_bars: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
54376
+ codex_get_token_bars: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
54377
+ get_token_chart_data: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
54378
+ get_token_chart_urls: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
54379
+ get_token_sparklines: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
54380
+ // price
54381
+ codex_get_token_price: "Use alchemy_get_token_prices_by_address or get_onchain_token_price for on-chain token prices.",
54382
+ // tokens
54383
+ codex_filter_launchpads: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54384
+ filter_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54385
+ get_new_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54386
+ get_token_details: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54387
+ get_token_transactions: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54388
+ get_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54389
+ list_top_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54390
+ search_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
54391
+ // network
54392
+ codex_get_blocks: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54393
+ codex_get_network_configs: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54394
+ filter_exchanges: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54395
+ filter_networks: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54396
+ get_network_dexes: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54397
+ get_network_stats: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54398
+ get_network_status: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54399
+ get_networks_list: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
54400
+ // locks
54401
+ get_liquidity_locks: "Use get_token_lock_info or the goplus_get_lp_v3_locks and goplus_get_lp_v4_locks security tools for LP locks.",
54402
+ // misc
54403
+ codex_get_categories: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
54404
+ codex_get_category: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
54405
+ codex_get_category_tokens: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
54406
+ get_community_notes: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
54407
+ get_event_labels: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data."
54408
+ };
54409
+ var PREDICTION_REPLACEMENT = 'Prediction markets are served by first-party Polymarket tools since 1.7.0: polymarket_search_markets, polymarket_get_events, polymarket_get_market, polymarket_get_price_history, polymarket_get_orderbook, polymarket_get_wallet_positions, polymarket_get_wallet_activity. Kalshi is not covered. Start with search_tools({"query": "prediction markets"}) or hive://toolsets/prediction_markets.';
54410
+ var UNSERVABLE_TOOLS_DATE = "2026-09-24";
54411
+ var COINGECKO_ENTERPRISE = "because it needs a CoinGecko Enterprise plan, which Hive does not have";
54412
+ var COINGECKO_SUPPLY_REPLACEMENT = "Use get_coin_supply_breakdown for current circulating, total, and max supply, or get_coin_market_chart_range for a market-cap and price series.";
54413
+ var HELIUS_WALLET_PLAN = "because Helius answers 403 for it on Hive's current Helius plan";
54414
+ var DEFILLAMA_PRO = "because it needs a DeFiLlama Pro plan, which Hive does not have";
54415
+ var DEFILLAMA_DERIVATIVES_REPLACEMENT = "Use defillama_get_open_interest, defillama_get_derivatives_aggregator_volumes, or get_derivatives_exchanges for derivatives activity.";
54416
+ var ALCHEMY_PAYG = "because Alchemy offers it only on Pay As You Go and Enterprise plans, and Hive's key is on the Free tier";
54417
+ var ALCHEMY_BUNDLE_REPLACEMENT = "Use tenderly_simulate_bundle for multi-transaction simulation, or alchemy_simulate_asset_changes and alchemy_simulate_execution one transaction at a time.";
54418
+ var CCXT_PRIVATE = "because every exchange that serves it requires an authenticated exchange account";
54419
+ var CCXT_BORROW_REPLACEMENT = "Use ccxt_fetch_borrow_rate_history or ccxt_fetch_borrow_rate_histories (public) and read the latest point.";
54420
+ var UNSERVABLE_TOOLS = {
54421
+ get_coin_circulating_supply_chart: {
54422
+ reason: COINGECKO_ENTERPRISE,
54423
+ replacement: COINGECKO_SUPPLY_REPLACEMENT
54424
+ },
54425
+ get_coin_circulating_supply_chart_range: {
54426
+ reason: COINGECKO_ENTERPRISE,
54427
+ replacement: COINGECKO_SUPPLY_REPLACEMENT
54428
+ },
54429
+ get_coin_total_supply_chart: {
54430
+ reason: COINGECKO_ENTERPRISE,
54431
+ replacement: COINGECKO_SUPPLY_REPLACEMENT
54432
+ },
54433
+ get_coin_total_supply_chart_range: {
54434
+ reason: COINGECKO_ENTERPRISE,
54435
+ replacement: COINGECKO_SUPPLY_REPLACEMENT
54436
+ },
54437
+ get_coin_insights: {
54438
+ reason: COINGECKO_ENTERPRISE,
54439
+ replacement: "No direct replacement; use get_coins_market_data and get_coin_tickers for the market facts behind an insight."
54440
+ },
54441
+ helius_get_wallet_identity: {
54442
+ reason: HELIUS_WALLET_PLAN,
54443
+ replacement: "No other wallet-identity source is live on Hive's plans; use helius_get_wallet_history or helius_get_transfers_by_address for the wallet's activity."
54444
+ },
54445
+ helius_get_wallet_batch_identity: {
54446
+ reason: HELIUS_WALLET_PLAN,
54447
+ replacement: "No other wallet-identity source is live on Hive's plans; use helius_get_wallet_history or helius_get_transfers_by_address for each wallet's activity."
54448
+ },
54449
+ helius_get_wallet_funded_by: {
54450
+ reason: HELIUS_WALLET_PLAN,
54451
+ replacement: "Use helius_get_wallet_transfers or helius_get_transfers_by_address and take the earliest inbound SOL transfer."
54452
+ },
54453
+ alchemy_simulate_asset_changes_bundle: {
54454
+ reason: ALCHEMY_PAYG,
54455
+ replacement: ALCHEMY_BUNDLE_REPLACEMENT
54456
+ },
54457
+ alchemy_simulate_execution_bundle: {
54458
+ reason: ALCHEMY_PAYG,
54459
+ replacement: ALCHEMY_BUNDLE_REPLACEMENT
54460
+ },
54461
+ defillama_get_derivatives_volumes: {
54462
+ reason: DEFILLAMA_PRO,
54463
+ replacement: DEFILLAMA_DERIVATIVES_REPLACEMENT
54464
+ },
54465
+ defillama_get_derivatives_volumes_by_chain: {
54466
+ reason: DEFILLAMA_PRO,
54467
+ replacement: DEFILLAMA_DERIVATIVES_REPLACEMENT
54468
+ },
54469
+ defillama_get_derivatives_volume: {
54470
+ reason: DEFILLAMA_PRO,
54471
+ replacement: DEFILLAMA_DERIVATIVES_REPLACEMENT
54472
+ },
54473
+ defillama_get_categories: {
54474
+ reason: DEFILLAMA_PRO,
54475
+ replacement: "Use get_categories_market_data for sector data, or get_defi_protocols, whose records carry each protocol's category."
54476
+ },
54477
+ defillama_get_oracles: {
54478
+ reason: DEFILLAMA_PRO,
54479
+ replacement: "Use get_defi_protocols or get_defi_protocol; protocol records list the oracles they use where DeFiLlama has them."
54480
+ },
54481
+ defillama_get_forks: {
54482
+ reason: DEFILLAMA_PRO,
54483
+ replacement: "Use get_defi_protocols; protocol records carry forkedFrom where DeFiLlama has it."
54484
+ },
54485
+ defillama_get_entities: {
54486
+ reason: DEFILLAMA_PRO,
54487
+ replacement: "Use get_entities_list or get_treasury_by_entity for public companies and their treasuries."
54488
+ },
54489
+ ccxt_fetch_cross_borrow_rates: {
54490
+ reason: CCXT_PRIVATE,
54491
+ replacement: CCXT_BORROW_REPLACEMENT
54492
+ },
54493
+ ccxt_fetch_cross_borrow_rate: {
54494
+ reason: CCXT_PRIVATE,
54495
+ replacement: CCXT_BORROW_REPLACEMENT
54496
+ },
54497
+ ccxt_fetch_isolated_borrow_rates: {
54498
+ reason: CCXT_PRIVATE,
54499
+ replacement: CCXT_BORROW_REPLACEMENT
54500
+ },
54501
+ goplus_simulate_solana_transaction: {
54502
+ reason: 'because GoPlus answers "system error" to every Solana pre-execution request, including a fresh valid transfer',
54503
+ replacement: "Use get_solana_token_security for the tokens the transaction touches; Hive has no other Solana pre-signing simulation."
54504
+ }
54505
+ };
54506
+ function isUnservableTool(toolName) {
54507
+ return Object.prototype.hasOwnProperty.call(UNSERVABLE_TOOLS, toolName);
54508
+ }
54509
+ function getRetiredTool(toolName) {
54510
+ if (isUnservableTool(toolName)) {
54511
+ const entry2 = UNSERVABLE_TOOLS[toolName];
54512
+ return {
54513
+ date: UNSERVABLE_TOOLS_DATE,
54514
+ cause: entry2.reason,
54515
+ replacement: entry2.replacement
54516
+ };
54517
+ }
54518
+ const replacement = getRetiredToolReplacement(toolName);
54519
+ return replacement ? {
54520
+ date: RETIRED_TOOLS_DATE,
54521
+ cause: "when the Codex.io provider was removed",
54522
+ replacement
54523
+ } : null;
54524
+ }
54525
+ function getRetiredToolReplacement(toolName) {
54526
+ if (isUnservableTool(toolName)) return UNSERVABLE_TOOLS[toolName].replacement;
54527
+ const direct = RETIRED_TOOL_REPLACEMENTS[toolName];
54528
+ if (direct) return direct;
54529
+ if (/^codex_/.test(toolName)) {
54530
+ return PREDICTION_REPLACEMENT;
54531
+ }
54532
+ return null;
54533
+ }
54534
+
54092
54535
  // src/wrapper/index.ts
54093
54536
  var CHARACTER_LIMIT = 1e5;
54094
54537
  var ANNOTATION_HEADROOM = 1024;
@@ -54479,6 +54922,7 @@ function createSafeHandler(handler96, metadata100, toolName) {
54479
54922
  }
54480
54923
  let result2 = await handler96(effectiveClient, safeArgs);
54481
54924
  const observedAt = (/* @__PURE__ */ new Date()).toISOString();
54925
+ if (result2._hiveExec?.source === "fallback") usedFallback = true;
54482
54926
  if (!result2.isError && credentialRequirement && !credentialRequirement.isConfigured() && result2?.content?.[0]?.type === "text" && result2.content[0].text) {
54483
54927
  const rawText = result2.content[0].text;
54484
54928
  let warningText;
@@ -54805,7 +55249,7 @@ function getAllWrappedEndpoints() {
54805
55249
  }
54806
55250
  }
54807
55251
  }
54808
- _wrappedEndpointsCache = updatedTools.map(normalizeEndpointSchema).map((endpoint) => ({
55252
+ _wrappedEndpointsCache = updatedTools.filter((endpoint) => !isUnservableTool(endpoint.tool.name)).map(normalizeEndpointSchema).map((endpoint) => ({
54809
55253
  ...endpoint,
54810
55254
  tool: withResponseHeadroomMeta(endpoint.tool)
54811
55255
  }));
@@ -54829,7 +55273,7 @@ var ToolRegistry = [
54829
55273
  {
54830
55274
  category: "Market Data and Price",
54831
55275
  name: "get_market_and_price_endpoints",
54832
- description: "Endpoints to retrieve real-time and historical cryptocurrency prices, market caps, trading volumes, OHLC data, global market statistics, supported currencies, basic market performance metrics across different timeframes and asset platforms, stablecoin market analytics, stablecoin price tracking, comprehensive stablecoin market cap data across multiple chains, centralized exchange (CEX) trading data including real-time tickers, order books, recent trades, candlestick charts, best bid/ask prices, CEX exchange metadata and volume charts, derivatives pricing (index, mark, and premium), perpetual futures funding rates, leverage tiers, options trading analytics, and available trading markets/currencies across major exchanges. Provider guide: Use coingecko tools for market-wide price data. Use ccxt_ tools for CEX trading data. Use alchemy_ tools for supported token price reads and EVM gas data. Use archive_ tools for cross-venue derivatives HISTORY (funding settlements, open interest, basis, long/short ratio, liquidations) since 2023-11.",
55276
+ description: "Endpoints to retrieve real-time and historical cryptocurrency prices, market caps, trading volumes, OHLC data, global market statistics, supported currencies, basic market performance metrics across different timeframes and asset platforms, stablecoin market analytics, stablecoin price tracking, comprehensive stablecoin market cap data across multiple chains, centralized exchange (CEX) trading data including real-time tickers, order books, recent trades, candlestick charts, best bid/ask prices, CEX exchange metadata and volume charts, derivatives pricing (index, mark, and premium), perpetual futures funding rates, leverage tiers, options trading analytics, and available trading markets/currencies across major exchanges. Provider guide: Use coingecko tools for market-wide price data. Use ccxt_ tools for CEX trading data. Use alchemy_ tools for supported token price reads and EVM gas data. Use archive_ tools for cross-venue derivatives HISTORY: funding settlements since 2023-11; open interest, basis, long/short ratio and liquidations over shorter windows (archive_get_coverage gives exact depth).",
54833
55277
  tools: [
54834
55278
  "get_coins_index",
54835
55279
  "get_coins_market_data",
@@ -54852,11 +55296,6 @@ var ToolRegistry = [
54852
55296
  "get_global_market_cap_chart",
54853
55297
  "get_coin_ohlc",
54854
55298
  "get_coin_ohlc_range",
54855
- "get_coin_insights",
54856
- "get_coin_circulating_supply_chart",
54857
- "get_coin_circulating_supply_chart_range",
54858
- "get_coin_total_supply_chart",
54859
- "get_coin_total_supply_chart_range",
54860
55299
  "get_rwa_list",
54861
55300
  "get_rwa_markets",
54862
55301
  "get_rwa_asset",
@@ -54981,9 +55420,6 @@ var ToolRegistry = [
54981
55420
  "ccxt_fetch_convert_quote",
54982
55421
  "ccxt_fetch_borrow_rate_history",
54983
55422
  "ccxt_fetch_borrow_rate_histories",
54984
- "ccxt_fetch_cross_borrow_rates",
54985
- "ccxt_fetch_cross_borrow_rate",
54986
- "ccxt_fetch_isolated_borrow_rates",
54987
55423
  "ccxt_fetch_funding_rates_multi",
54988
55424
  "ccxt_fetch_open_interest_multi",
54989
55425
  "alchemy_get_token_prices_by_symbol",
@@ -55142,13 +55578,10 @@ var ToolRegistry = [
55142
55578
  "helius_get_parsed_address_transactions",
55143
55579
  "helius_get_parsed_events_transactions",
55144
55580
  "helius_get_parsed_events_transaction_history",
55145
- "helius_get_wallet_identity",
55146
- "helius_get_wallet_batch_identity",
55147
55581
  "helius_get_wallet_balances",
55148
55582
  "helius_get_wallet_balance_at",
55149
55583
  "helius_get_wallet_history",
55150
55584
  "helius_get_wallet_transfers",
55151
- "helius_get_wallet_funded_by",
55152
55585
  "helius_get_transactions_for_address",
55153
55586
  "helius_get_transfers_by_address"
55154
55587
  ]
@@ -55233,13 +55666,6 @@ var ToolRegistry = [
55233
55666
  "defillama_get_open_interest_by_chain",
55234
55667
  "defillama_get_open_interest_protocol",
55235
55668
  // Coverage wave 1: perps-protocol volumes + protocol metadata
55236
- "defillama_get_derivatives_volumes",
55237
- "defillama_get_derivatives_volumes_by_chain",
55238
- "defillama_get_derivatives_volume",
55239
- "defillama_get_categories",
55240
- "defillama_get_oracles",
55241
- "defillama_get_forks",
55242
- "defillama_get_entities",
55243
55669
  // Moralis DeFi / volume analytics
55244
55670
  "moralis_get_defi_positions_by_protocol",
55245
55671
  "moralis_get_supported_defi_protocols",
@@ -55345,7 +55771,6 @@ var ToolRegistry = [
55345
55771
  "goplus_detect_dust_attack",
55346
55772
  "goplus_start_address_scan",
55347
55773
  "goplus_get_address_scan_result",
55348
- "goplus_simulate_solana_transaction",
55349
55774
  "goplus_get_lp_v4_lock",
55350
55775
  "goplus_get_lp_v4_locks",
55351
55776
  "goplus_get_lp_v3_lock",
@@ -55375,9 +55800,7 @@ var ToolRegistry = [
55375
55800
  "tenderly_get_transactions_range",
55376
55801
  "alchemy_get_token_allowance",
55377
55802
  "alchemy_simulate_asset_changes",
55378
- "alchemy_simulate_execution",
55379
- "alchemy_simulate_asset_changes_bundle",
55380
- "alchemy_simulate_execution_bundle"
55803
+ "alchemy_simulate_execution"
55381
55804
  ]
55382
55805
  },
55383
55806
  {
@@ -57087,83 +57510,6 @@ function clientProfileFromName(raw) {
57087
57510
  return normalizeClientName(raw).profile;
57088
57511
  }
57089
57512
 
57090
- // src/config/retiredTools.ts
57091
- var RETIRED_TOOLS_DATE = "2026-09-06";
57092
- var RETIRED_TOOL_REPLACEMENTS = {
57093
- // wallet
57094
- codex_filter_wallets_by_network: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57095
- codex_get_wallet_aggregate_backfill_state: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57096
- codex_get_wallet_label_types: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57097
- filter_network_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57098
- filter_token_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57099
- filter_wallets: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57100
- get_wallet_balances: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57101
- get_wallet_chart: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57102
- get_wallet_stats: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57103
- get_wallet_token_events: "Use alchemy_get_token_balances_by_wallet, alchemy_get_asset_transfers, or moralis_get_wallet_profitability_summary for wallet balances, transfers, and PnL.",
57104
- // holders
57105
- get_token_holders: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
57106
- get_token_top_traders: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
57107
- get_top_holders_percentage: "Use get_token_top_holders for holders on any network, coingecko_get_onchain_token_top_traders for traders where CoinGecko serves them (base and similar; not Ethereum on the current plan), or moralis_get_token_holder_metrics for holder metrics.",
57108
- // pairs
57109
- codex_get_detailed_token_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57110
- codex_get_windowed_pair_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57111
- filter_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57112
- get_detailed_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57113
- get_latest_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57114
- get_liquidity_info: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57115
- get_pair_chart_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57116
- get_pair_info: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57117
- get_pair_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57118
- get_pairs_stats: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57119
- get_token_liquidity_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57120
- get_token_pairs: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57121
- get_token_pairs_metadata: "Use get_token_pools, get_pool_info, get_pools_by_address, moralis_get_pair_stats, or get_new_pools for pool and pair data.",
57122
- // charts
57123
- codex_get_bars: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
57124
- codex_get_token_bars: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
57125
- get_token_chart_data: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
57126
- get_token_chart_urls: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
57127
- get_token_sparklines: "Use get_token_ohlcv, get_pool_ohlcv, or moralis_get_pair_ohlcv for candles.",
57128
- // price
57129
- codex_get_token_price: "Use alchemy_get_token_prices_by_address or get_onchain_token_price for on-chain token prices.",
57130
- // tokens
57131
- codex_filter_launchpads: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57132
- filter_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57133
- get_new_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57134
- get_token_details: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57135
- get_token_transactions: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57136
- get_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57137
- list_top_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57138
- search_tokens: "Use get_token_info, alchemy_get_token_metadata, moralis_search_tokens, get_new_pools, or get_token_trades for token discovery and activity.",
57139
- // network
57140
- codex_get_blocks: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57141
- codex_get_network_configs: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57142
- filter_exchanges: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57143
- filter_networks: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57144
- get_network_dexes: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57145
- get_network_stats: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57146
- get_network_status: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57147
- get_networks_list: "Use get_networks, tenderly_get_supported_networks, alchemy_get_block_by_number, or get_dexes for network and DEX reads.",
57148
- // locks
57149
- get_liquidity_locks: "Use get_token_lock_info or the goplus_get_lp_v3_locks and goplus_get_lp_v4_locks security tools for LP locks.",
57150
- // misc
57151
- codex_get_categories: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
57152
- codex_get_category: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
57153
- codex_get_category_tokens: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
57154
- get_community_notes: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data.",
57155
- get_event_labels: "No direct replacement; use get_categories_market_data or moralis_get_entity_categories for category data."
57156
- };
57157
- var PREDICTION_REPLACEMENT = 'Prediction markets are served by first-party Polymarket tools since 1.7.0: polymarket_search_markets, polymarket_get_events, polymarket_get_market, polymarket_get_price_history, polymarket_get_orderbook, polymarket_get_wallet_positions, polymarket_get_wallet_activity. Kalshi is not covered. Start with search_tools({"query": "prediction markets"}) or hive://toolsets/prediction_markets.';
57158
- function getRetiredToolReplacement(toolName) {
57159
- const direct = RETIRED_TOOL_REPLACEMENTS[toolName];
57160
- if (direct) return direct;
57161
- if (/^codex_/.test(toolName)) {
57162
- return PREDICTION_REPLACEMENT;
57163
- }
57164
- return null;
57165
- }
57166
-
57167
57513
  // src/services/tool-execution-pipeline.ts
57168
57514
  function isToolExecutionBilling(value) {
57169
57515
  return typeof value === "object" && value !== null && value.type === "billing";
@@ -57326,6 +57672,27 @@ function createHiveExecutionMetadata(endpoint, durationMs, runtimeStatus, source
57326
57672
  function unchargedCredit(context) {
57327
57673
  return context.creditCost === void 0 ? {} : { creditCost: context.creditCost, creditsUsed: 0 };
57328
57674
  }
57675
+ var FAILED_CALL_REFUND_WARNING = "This call failed, so the credit it used was refunded.";
57676
+ async function refundFailedCall(billing, toolName, runtimeStatus, warnings) {
57677
+ if (!billing?.refund || billing.credits_used <= 0) return billing;
57678
+ try {
57679
+ const outcome = await billing.refund({ toolName, runtimeStatus });
57680
+ if (!outcome.refunded) return billing;
57681
+ warnings.push(FAILED_CALL_REFUND_WARNING);
57682
+ return {
57683
+ ...billing,
57684
+ credits_used: 0,
57685
+ ...outcome.creditsRemaining !== void 0 && {
57686
+ credits_remaining: outcome.creditsRemaining
57687
+ }
57688
+ };
57689
+ } catch (error) {
57690
+ secureLogger.error("Credit refund for a failed call failed", error, {
57691
+ toolName
57692
+ });
57693
+ return billing;
57694
+ }
57695
+ }
57329
57696
  function chargedCredit(context, billing) {
57330
57697
  if (context.creditCost === void 0 && !billing) return {};
57331
57698
  return {
@@ -57484,9 +57851,10 @@ function unavailableReplacementNote(guidance) {
57484
57851
  ).join(" ");
57485
57852
  }
57486
57853
  function createToolNotFoundResult(toolName, durationMs = 0) {
57487
- const retired = getRetiredToolReplacement(toolName);
57854
+ const retiredTool = getRetiredTool(toolName);
57855
+ const retired = retiredTool?.replacement ?? null;
57488
57856
  const availabilityNote = retired ? unavailableReplacementNote(retired) : "";
57489
- const message = retired ? `Tool '${toolName}' was retired on ${RETIRED_TOOLS_DATE}. ${retired}${availabilityNote}` : `Tool '${toolName}' not found.`;
57857
+ const message = retiredTool ? `Tool '${toolName}' was retired on ${retiredTool.date}. ${retired}${availabilityNote}` : `Tool '${toolName}' not found.`;
57490
57858
  const errorCode = retired ? "TOOL_RETIRED" : "TOOL_NOT_FOUND";
57491
57859
  const mcpResult = createErrorResponse7(errorCode, message);
57492
57860
  const hive = {
@@ -57514,7 +57882,7 @@ function createToolNotFoundResult(toolName, durationMs = 0) {
57514
57882
  warnings: [
57515
57883
  retired ? "Tool name was retired; the replacement is named in the message." : "Tool name did not resolve to a Hive endpoint."
57516
57884
  ],
57517
- cause: retired ? `Tool '${toolName}' was retired on ${RETIRED_TOOLS_DATE} when the Codex.io provider was removed; nothing was executed.` : `Tool '${toolName}' does not resolve to a Hive endpoint; nothing was executed.`,
57885
+ cause: retiredTool ? `Tool '${toolName}' was retired on ${retiredTool.date} ${retiredTool.cause}; nothing was executed.` : `Tool '${toolName}' does not resolve to a Hive endpoint; nothing was executed.`,
57518
57886
  next_action: retired ? `${retired}${availabilityNote} Call search_tools with your task if that tool does not fit.` : "Call search_tools (or a category endpoint tools/list) to find the exact endpoint name, then retry with that name."
57519
57887
  };
57520
57888
  const enrichedMcpResult = attachHiveMetadata(mcpResult, hive);
@@ -57921,6 +58289,14 @@ async function executeEndpoint(endpoint, args, context) {
57921
58289
  );
57922
58290
  }
57923
58291
  }
58292
+ if (normalized.isError) {
58293
+ billing = await refundFailedCall(
58294
+ billing,
58295
+ endpoint.tool.name,
58296
+ runtimeStatus,
58297
+ guardWarnings
58298
+ );
58299
+ }
57924
58300
  const durationMs = Date.now() - start;
57925
58301
  const hive = createHiveExecutionMetadata(
57926
58302
  endpoint,
@@ -58000,12 +58376,21 @@ async function executeEndpoint(endpoint, args, context) {
58000
58376
  endpoint.tool.name,
58001
58377
  args
58002
58378
  );
58379
+ const thrownWarnings = [
58380
+ "Tool execution threw before returning a provider result."
58381
+ ];
58382
+ billing = await refundFailedCall(
58383
+ billing,
58384
+ endpoint.tool.name,
58385
+ runtimeStatus,
58386
+ thrownWarnings
58387
+ );
58003
58388
  const hive = createHiveExecutionMetadata(
58004
58389
  endpoint,
58005
58390
  durationMs,
58006
58391
  runtimeStatus,
58007
58392
  "unavailable",
58008
- ["Tool execution threw before returning a provider result."],
58393
+ thrownWarnings,
58009
58394
  void 0,
58010
58395
  {
58011
58396
  input: args ?? {},
@@ -59369,7 +59754,7 @@ var TASK_TOOLSET_ROUTES = {
59369
59754
  {
59370
59755
  id: "transaction_readiness",
59371
59756
  label: "Solana transaction readiness",
59372
- trigger: "Solana transaction details, priority fee, compression context, or pre-execution risk.",
59757
+ trigger: "Solana transaction details, priority fee, compression context, or the risk of the tokens it touches.",
59373
59758
  exampleQuestion: "Inspect this Solana transaction and tell me whether the proposed call looks safe.",
59374
59759
  requiredIdentifiers: ["transaction signature or serialized transaction"],
59375
59760
  maxMaterialCalls: 4,
@@ -59389,12 +59774,12 @@ var TASK_TOOLSET_ROUTES = {
59389
59774
  ),
59390
59775
  step(
59391
59776
  "risk",
59392
- "Simulate a serialized transaction without broadcasting.",
59393
- "goplus_simulate_solana_transaction",
59777
+ "Check GoPlus token security for the mints the transaction touches.",
59778
+ "get_solana_token_security",
59394
59779
  null
59395
59780
  )
59396
59781
  ],
59397
- stopCondition: "Stop after transaction context and the requested fee or simulation check; never submit the transaction."
59782
+ stopCondition: "Stop after transaction context and the requested fee or token security check; never submit the transaction."
59398
59783
  }
59399
59784
  ],
59400
59785
  rwa_perp_analysis: [
@@ -59751,10 +60136,8 @@ var TASK_TOOLSET_CATALOG = [
59751
60136
  "hyperliquid_get_outcome_meta",
59752
60137
  "hyperliquid_get_all_borrow_lend_reserve_states",
59753
60138
  "ccxt_fetch_option_chain",
59754
- "ccxt_fetch_cross_borrow_rates",
59755
60139
  "get_exchange_tickers",
59756
- "get_supported_currencies",
59757
- "get_coin_insights"
60140
+ "get_supported_currencies"
59758
60141
  ],
59759
60142
  stableFixtures: [
59760
60143
  {
@@ -59829,11 +60212,7 @@ var TASK_TOOLSET_CATALOG = [
59829
60212
  "get_contract_coin",
59830
60213
  "coingecko_get_onchain_token_top_traders",
59831
60214
  "get_solana_token_security",
59832
- "get_coin_supply_breakdown",
59833
- "get_coin_circulating_supply_chart",
59834
- "get_coin_circulating_supply_chart_range",
59835
- "get_coin_total_supply_chart",
59836
- "get_coin_total_supply_chart_range"
60215
+ "get_coin_supply_breakdown"
59837
60216
  ],
59838
60217
  stableFixtures: [
59839
60218
  {
@@ -59982,10 +60361,7 @@ var TASK_TOOLSET_CATALOG = [
59982
60361
  "alchemy_solana_get_latest_non_voting_signatures",
59983
60362
  "alchemy_simulate_asset_changes",
59984
60363
  "alchemy_simulate_execution",
59985
- "alchemy_simulate_asset_changes_bundle",
59986
- "alchemy_simulate_execution_bundle",
59987
60364
  "simulate_evm_transaction",
59988
- "goplus_simulate_solana_transaction",
59989
60365
  "defillama_get_hacks"
59990
60366
  ],
59991
60367
  fallbackTools: [
@@ -60105,8 +60481,6 @@ var TASK_TOOLSET_CATALOG = [
60105
60481
  "defillama_get_bridge_aggregator_volumes",
60106
60482
  "defillama_get_bridge_aggregator_volumes_by_chain",
60107
60483
  "get_dex_volumes",
60108
- "defillama_get_derivatives_volumes",
60109
- "defillama_get_derivatives_volume",
60110
60484
  "moralis_get_supported_defi_protocols",
60111
60485
  "moralis_get_wallet_defi_positions"
60112
60486
  ],
@@ -60118,12 +60492,7 @@ var TASK_TOOLSET_CATALOG = [
60118
60492
  "get_chains_tvl_history",
60119
60493
  "get_stablecoin_chains",
60120
60494
  "stablecoin_data_by_id",
60121
- "get_fees_overview",
60122
- "defillama_get_derivatives_volumes_by_chain",
60123
- "defillama_get_categories",
60124
- "defillama_get_oracles",
60125
- "defillama_get_forks",
60126
- "defillama_get_entities"
60495
+ "get_fees_overview"
60127
60496
  ],
60128
60497
  stableFixtures: [
60129
60498
  {
@@ -60309,12 +60678,10 @@ var TASK_TOOLSET_CATALOG = [
60309
60678
  "moralis_get_sol_token_prices_batch",
60310
60679
  "moralis_get_token_analytics_timeseries",
60311
60680
  "moralis_get_sol_token_swaps",
60312
- "get_solana_token_security",
60313
- "goplus_simulate_solana_transaction"
60681
+ "get_solana_token_security"
60314
60682
  ],
60315
60683
  fallbackTools: [
60316
60684
  "get_token_top_holders",
60317
- "helius_get_wallet_identity",
60318
60685
  "helius_get_wallet_history",
60319
60686
  "helius_get_program_accounts_v2",
60320
60687
  "helius_get_parsed_transactions",
@@ -65630,8 +65997,9 @@ var FULL_MODE_DEFAULT_ARGS = {
65630
65997
  user: HYPERLIQUID_USER,
65631
65998
  builder: HYPERLIQUID_USER,
65632
65999
  vault_address: HYPERLIQUID_HLP_VAULT,
65633
- // Spot token index 0 (USDC) — canonical 34-char zero tokenId.
65634
- token_id: "0x00000000000000000000000000000000",
66000
+ // USDC's real tokenId (spotMeta tokens[0]); the all-zero id is unknown to
66001
+ // Hyperliquid and answers 500.
66002
+ token_id: "0x6d1e7cde53ba9467b783cb7c530ce054",
65635
66003
  token: 0,
65636
66004
  // First HIP-4 outcome market id.
65637
66005
  outcome: 0
@@ -66135,9 +66503,11 @@ var TOOL_PROBE_ARGS = {
66135
66503
  network: "mainnet",
66136
66504
  input: `${ERC20_TRANSFER_SELECTOR}${"0".repeat(128)}`
66137
66505
  },
66506
+ // A plain zero-value transfer between EOAs: a call into USDC with empty
66507
+ // calldata reverts, and estimateGas reports a revert as an error.
66138
66508
  tenderly_node_estimate_gas: {
66139
66509
  network: "mainnet",
66140
- transaction: { from: ETH_WALLET, to: ETH_USDC, data: "0x" },
66510
+ transaction: { from: ETH_WALLET, to: MORALIS_EVM_WALLET, value: "0x0" },
66141
66511
  block_number: "latest"
66142
66512
  },
66143
66513
  tenderly_node_simulate_transaction: {
@@ -66160,10 +66530,16 @@ var TOOL_PROBE_ARGS = {
66160
66530
  network: "mainnet",
66161
66531
  data: "0x08c379a0"
66162
66532
  },
66533
+ // A complete ERC-20 Transfer log (from, to indexed; amount in data). The
66534
+ // signature topic alone with empty data is rejected as bad input.
66163
66535
  tenderly_decode_event: {
66164
66536
  network: "mainnet",
66165
- topics: [ERC20_TRANSFER_TOPIC],
66166
- data: "0x"
66537
+ topics: [
66538
+ ERC20_TRANSFER_TOPIC,
66539
+ "0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045",
66540
+ "0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
66541
+ ],
66542
+ data: "0x00000000000000000000000000000000000000000000000000000000000f4240"
66167
66543
  },
66168
66544
  tenderly_get_error_signatures: {
66169
66545
  network: "mainnet",
@@ -66456,9 +66832,10 @@ var TOOL_PROBE_ARGS = {
66456
66832
  page: 1,
66457
66833
  limit: 1
66458
66834
  },
66835
+ // DAS asset signatures are defined for compressed assets.
66459
66836
  alchemy_solana_get_asset_signatures: {
66460
66837
  network: "solana-mainnet",
66461
- id: SOL_HELIUS_ASSET,
66838
+ id: SOL_COMPRESSED_ASSET,
66462
66839
  page: 1,
66463
66840
  limit: 1
66464
66841
  },
@@ -66935,6 +67312,32 @@ function extractGoPlusAddressScanArgs(response) {
66935
67312
  );
66936
67313
  return requestId ? { request_id: requestId } : null;
66937
67314
  }
67315
+ function findFirstObjectWithKey(value, keys) {
67316
+ if (!value || typeof value !== "object") return null;
67317
+ if (Array.isArray(value)) {
67318
+ for (const item of value) {
67319
+ const found = findFirstObjectWithKey(item, keys);
67320
+ if (found) return found;
67321
+ }
67322
+ return null;
67323
+ }
67324
+ const obj = value;
67325
+ if (keys.some((key) => typeof obj[key] === "string")) return obj;
67326
+ for (const child of Object.values(obj)) {
67327
+ const found = findFirstObjectWithKey(child, keys);
67328
+ if (found) return found;
67329
+ }
67330
+ return null;
67331
+ }
67332
+ function firstString(value, keys) {
67333
+ const obj = findFirstObjectWithKey(value, keys);
67334
+ if (!obj) return void 0;
67335
+ for (const key of keys) {
67336
+ const candidate = obj[key];
67337
+ if (typeof candidate === "string" && candidate) return candidate;
67338
+ }
67339
+ return void 0;
67340
+ }
66938
67341
  function getCachedDynamicArgs(cacheKey2, resolver) {
66939
67342
  const cached = dynamicProbeArgCache.get(cacheKey2);
66940
67343
  if (cached) return cached;
@@ -66996,6 +67399,29 @@ async function getCcxtSettlementArgs(clients) {
66996
67399
  return { exchange: "okx", symbol, limit: 10 };
66997
67400
  });
66998
67401
  }
67402
+ var HIVE_FIXTURE_MISSING = "No Hive fixture";
67403
+ var HIVE_ID_FIXTURES = {
67404
+ hive_get_monitor: {
67405
+ listTool: "hive_list_monitors",
67406
+ field: "monitor_id",
67407
+ keys: ["monitor_id", "id"]
67408
+ },
67409
+ hive_get_latest_snapshot: {
67410
+ listTool: "hive_list_monitors",
67411
+ field: "monitor_id",
67412
+ keys: ["monitor_id", "id"]
67413
+ },
67414
+ hive_generate_monitor_report: {
67415
+ listTool: "hive_list_monitors",
67416
+ field: "monitor_id",
67417
+ keys: ["monitor_id", "id"]
67418
+ },
67419
+ hive_get_subject: {
67420
+ listTool: "hive_list_subjects",
67421
+ field: "subject_id",
67422
+ keys: ["subject_id", "id"]
67423
+ }
67424
+ };
66999
67425
  async function getEffectiveProbeArgs(toolName, provider, clients, args) {
67000
67426
  if (args) return args;
67001
67427
  if (toolName === "ccxt_fetch_option" || toolName === "ccxt_fetch_greeks") {
@@ -67032,7 +67458,28 @@ async function getEffectiveProbeArgs(toolName, provider, clients, args) {
67032
67458
  return fixture;
67033
67459
  }
67034
67460
  if (provider === "hive") {
67035
- return {};
67461
+ const idFixture = HIVE_ID_FIXTURES[toolName];
67462
+ if (!idFixture) return {};
67463
+ return getCachedDynamicArgs(`hive:${idFixture.listTool}`, async () => {
67464
+ const listEndpoint = getAllWrappedEndpoints().find(
67465
+ (endpoint) => endpoint.tool.name === idFixture.listTool
67466
+ );
67467
+ if (!listEndpoint) {
67468
+ throw new Error(`${HIVE_FIXTURE_MISSING}: ${idFixture.listTool} is not registered`);
67469
+ }
67470
+ const context = await getHiveCanarySubjectContext();
67471
+ const listed = await runWithSubjectContext(
67472
+ context,
67473
+ () => listEndpoint.handler(null, { limit: 1 })
67474
+ );
67475
+ const id = firstString(parseToolResponseJson(listed), idFixture.keys);
67476
+ if (!id) {
67477
+ throw new Error(
67478
+ `${HIVE_FIXTURE_MISSING}: the canary subject has no ${idFixture.field.replace("_id", "")} to read yet`
67479
+ );
67480
+ }
67481
+ return { [idFixture.field]: id };
67482
+ });
67036
67483
  }
67037
67484
  const toolFixture = TOOL_PROBE_ARGS[toolName];
67038
67485
  if (toolFixture) return toolFixture;
@@ -67129,6 +67576,14 @@ async function runEndpointProbe(endpoint, provider, clients, args, timeoutMs = P
67129
67576
  return { name: toolName, status: "passed", duration };
67130
67577
  } catch (err) {
67131
67578
  const errorMsg = err instanceof Error ? err.message : "Unknown error";
67579
+ if (errorMsg.startsWith(HIVE_FIXTURE_MISSING)) {
67580
+ return {
67581
+ name: toolName,
67582
+ status: "skipped",
67583
+ duration: Date.now() - start,
67584
+ error: errorMsg
67585
+ };
67586
+ }
67132
67587
  if (shouldRetryGoPlusRateLimit(provider, errorMsg, attempt, maxAttempts)) {
67133
67588
  await delay(GOPLUS_RATE_LIMIT_RETRY_DELAY_MS * attempt);
67134
67589
  continue;
@@ -70036,7 +70491,7 @@ function dynamicTools(endpoints, options = {}) {
70036
70491
  tool: {
70037
70492
  name: "get_api_endpoint_schema",
70038
70493
  title: "API Endpoint Schema",
70039
- description: "Returns the full input schema, operation type, and correct root invoker for any Hive tool by name. Call a category tool first to discover available tool names, then inspect this contract before execution.",
70494
+ description: "Returns the full input schema, operation type, and correct root invoker for any Hive tool by name. Tool names come from search_tools; inspect this contract before execution.",
70040
70495
  inputSchema: {
70041
70496
  ...zodToInputSchema2(getEndpointSchema),
70042
70497
  additionalProperties: true
@@ -70045,18 +70500,13 @@ function dynamicTools(endpoints, options = {}) {
70045
70500
  annotations: READ_ONLY_ANNOTATIONS
70046
70501
  },
70047
70502
  handler: async (_client, args) => {
70048
- if (!args) {
70049
- return errorResult6(
70050
- "No endpoint provided. Pass an 'endpoint' (or 'endpoint_name') parameter with the tool name."
70051
- );
70052
- }
70053
- const parsedEndpointArgs = getEndpointSchema.parse(args);
70503
+ const missingEndpoint = "Invalid arguments: no endpoint provided. Pass an 'endpoint' (or 'endpoint_name') parameter with one tool name as a string.";
70504
+ if (!args) return errorResult6(missingEndpoint);
70505
+ const parsedArgs = getEndpointSchema.safeParse(args);
70506
+ if (!parsedArgs.success) return errorResult6(missingEndpoint);
70507
+ const parsedEndpointArgs = parsedArgs.data;
70054
70508
  const requestedEndpoint = parsedEndpointArgs.endpoint ?? parsedEndpointArgs.endpoint_name ?? firstStringArg(args, ENDPOINT_NAME_ALIASES);
70055
- if (!requestedEndpoint) {
70056
- return errorResult6(
70057
- "No endpoint provided. Pass an 'endpoint' (or 'endpoint_name') parameter with the tool name."
70058
- );
70059
- }
70509
+ if (!requestedEndpoint) return errorResult6(missingEndpoint);
70060
70510
  const lookup = resolveEndpoint(endpoints, requestedEndpoint);
70061
70511
  const metaEndpoint = lookup.ok ? void 0 : [
70062
70512
  searchToolsTool,