chain-insights 0.2.24 → 0.2.26
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.
- package/dist/cli.cjs +8 -8
- package/dist/cli.mjs +8 -8
- package/dist/mcp-proxy.cjs +28 -7
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +28 -7
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-q4NMdmDX.cjs → public-tools-BwguvIsf.cjs} +12 -5
- package/dist/{public-tools-w7En2m3q.mjs → public-tools-DoRNhMn9.mjs} +13 -6
- package/dist/public-tools-DoRNhMn9.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/public-tools-w7En2m3q.mjs.map +0 -1
package/dist/cli.cjs
CHANGED
|
@@ -394,7 +394,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
394
394
|
}));
|
|
395
395
|
return;
|
|
396
396
|
}
|
|
397
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
397
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
398
398
|
const result = await addressRisk(client, {
|
|
399
399
|
address: opts.address,
|
|
400
400
|
network: opts.network,
|
|
@@ -422,7 +422,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
422
422
|
}));
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
|
-
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-
|
|
425
|
+
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
426
426
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
427
427
|
const result = await trackFunds(client, config, {
|
|
428
428
|
trustedAddresses: opts.trustedAddresses,
|
|
@@ -445,7 +445,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
445
445
|
const { requireWorkspaceRoot } = await Promise.resolve().then(() => require("./output-root-YIbl6PwF.cjs")).then((n) => n.output_root_exports);
|
|
446
446
|
requireWorkspaceRoot();
|
|
447
447
|
await withGraphMcpClient("chain-insights-cli-scam-topology", async (client, config) => {
|
|
448
|
-
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-
|
|
448
|
+
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
449
449
|
const incidentTimestampMs = optionalNumber(opts.incidentTimestampMs);
|
|
450
450
|
if (incidentTimestampMs === void 0) throw new Error("incident-timestamp-ms is required");
|
|
451
451
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
@@ -467,7 +467,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
467
467
|
})).addCommand(new commander.Command("stake-insights").description("Explain Bittensor staking behavior around an address, coldkey, or hotkey").requiredOption("--network <network>", "Network to query. Run `cia mcp networks` for supported networks.").option("--address <address>", "Full Bittensor address to inspect as either coldkey or hotkey").option("--coldkey <address>", "Full Bittensor coldkey address to inspect").option("--hotkey <address>", "Full Bittensor hotkey address to inspect").option("--netuid <number>", "Optional subnet netuid filter").option("--start-timestamp-ms <milliseconds>", "Optional inclusive lower activity timestamp bound").option("--end-timestamp-ms <milliseconds>", "Optional inclusive upper activity timestamp bound").option("--start-block <number>", "Optional start block. Current stake graph parity may require timestamp windows instead.").option("--end-block <number>", "Optional end block. Current stake graph parity may require timestamp windows instead.").option("--depth <number>", "Optional expansion depth limit, default 1, max 3").action(async (opts) => {
|
|
468
468
|
try {
|
|
469
469
|
await withGraphMcpClient("chain-insights-cli-stake-insights", async (client) => {
|
|
470
|
-
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-
|
|
470
|
+
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
471
471
|
const result = await stakeInsights(client, {
|
|
472
472
|
network: opts.network,
|
|
473
473
|
address: opts.address,
|
|
@@ -495,7 +495,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
495
495
|
assertPublicMcpToolName(tool);
|
|
496
496
|
await withGraphMcpClient("chain-insights-cli-call", async (client, config) => {
|
|
497
497
|
if (tool === "address_risk") {
|
|
498
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
498
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
499
499
|
const result = await addressRisk(client, {
|
|
500
500
|
address: String(args["address"] ?? ""),
|
|
501
501
|
network: String(args["network"] ?? ""),
|
|
@@ -505,7 +505,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
507
|
if (tool === "track_funds") {
|
|
508
|
-
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-
|
|
508
|
+
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
509
509
|
const result = await trackFunds(client, config, {
|
|
510
510
|
trustedAddresses: args["trusted_addresses"] ?? "",
|
|
511
511
|
untrustedAddresses: args["untrusted_addresses"],
|
|
@@ -520,7 +520,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
522
522
|
if (tool === "scam_topology") {
|
|
523
|
-
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-
|
|
523
|
+
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
524
524
|
const victimAddress = String(args["victim_address"] ?? "").trim();
|
|
525
525
|
if (!victimAddress) throw new Error("victim_address is required");
|
|
526
526
|
const incidentTimestampMs = optionalNumberArg(args["incident_timestamp_ms"], "incident_timestamp_ms");
|
|
@@ -538,7 +538,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
540
|
if (tool === "stake_insights") {
|
|
541
|
-
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-
|
|
541
|
+
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
542
542
|
const result = await stakeInsights(client, {
|
|
543
543
|
network: String(args["network"] ?? ""),
|
|
544
544
|
address: args["address"] === void 0 ? void 0 : String(args["address"]),
|
package/dist/cli.mjs
CHANGED
|
@@ -392,7 +392,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
392
392
|
}));
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
const { addressRisk } = await import("./public-tools-
|
|
395
|
+
const { addressRisk } = await import("./public-tools-DoRNhMn9.mjs");
|
|
396
396
|
const result = await addressRisk(client, {
|
|
397
397
|
address: opts.address,
|
|
398
398
|
network: opts.network,
|
|
@@ -420,7 +420,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
420
420
|
}));
|
|
421
421
|
return;
|
|
422
422
|
}
|
|
423
|
-
const { trackFunds } = await import("./public-tools-
|
|
423
|
+
const { trackFunds } = await import("./public-tools-DoRNhMn9.mjs");
|
|
424
424
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
425
425
|
const result = await trackFunds(client, config, {
|
|
426
426
|
trustedAddresses: opts.trustedAddresses,
|
|
@@ -443,7 +443,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
443
443
|
const { requireWorkspaceRoot } = await import("./output-root-BRhzhhXZ.mjs").then((n) => n.t);
|
|
444
444
|
requireWorkspaceRoot();
|
|
445
445
|
await withGraphMcpClient("chain-insights-cli-scam-topology", async (client, config) => {
|
|
446
|
-
const { scamTopology } = await import("./public-tools-
|
|
446
|
+
const { scamTopology } = await import("./public-tools-DoRNhMn9.mjs");
|
|
447
447
|
const incidentTimestampMs = optionalNumber(opts.incidentTimestampMs);
|
|
448
448
|
if (incidentTimestampMs === void 0) throw new Error("incident-timestamp-ms is required");
|
|
449
449
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
@@ -465,7 +465,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
465
465
|
})).addCommand(new Command("stake-insights").description("Explain Bittensor staking behavior around an address, coldkey, or hotkey").requiredOption("--network <network>", "Network to query. Run `cia mcp networks` for supported networks.").option("--address <address>", "Full Bittensor address to inspect as either coldkey or hotkey").option("--coldkey <address>", "Full Bittensor coldkey address to inspect").option("--hotkey <address>", "Full Bittensor hotkey address to inspect").option("--netuid <number>", "Optional subnet netuid filter").option("--start-timestamp-ms <milliseconds>", "Optional inclusive lower activity timestamp bound").option("--end-timestamp-ms <milliseconds>", "Optional inclusive upper activity timestamp bound").option("--start-block <number>", "Optional start block. Current stake graph parity may require timestamp windows instead.").option("--end-block <number>", "Optional end block. Current stake graph parity may require timestamp windows instead.").option("--depth <number>", "Optional expansion depth limit, default 1, max 3").action(async (opts) => {
|
|
466
466
|
try {
|
|
467
467
|
await withGraphMcpClient("chain-insights-cli-stake-insights", async (client) => {
|
|
468
|
-
const { stakeInsights } = await import("./public-tools-
|
|
468
|
+
const { stakeInsights } = await import("./public-tools-DoRNhMn9.mjs");
|
|
469
469
|
const result = await stakeInsights(client, {
|
|
470
470
|
network: opts.network,
|
|
471
471
|
address: opts.address,
|
|
@@ -493,7 +493,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
493
493
|
assertPublicMcpToolName(tool);
|
|
494
494
|
await withGraphMcpClient("chain-insights-cli-call", async (client, config) => {
|
|
495
495
|
if (tool === "address_risk") {
|
|
496
|
-
const { addressRisk } = await import("./public-tools-
|
|
496
|
+
const { addressRisk } = await import("./public-tools-DoRNhMn9.mjs");
|
|
497
497
|
const result = await addressRisk(client, {
|
|
498
498
|
address: String(args["address"] ?? ""),
|
|
499
499
|
network: String(args["network"] ?? ""),
|
|
@@ -503,7 +503,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
if (tool === "track_funds") {
|
|
506
|
-
const { trackFunds } = await import("./public-tools-
|
|
506
|
+
const { trackFunds } = await import("./public-tools-DoRNhMn9.mjs");
|
|
507
507
|
const result = await trackFunds(client, config, {
|
|
508
508
|
trustedAddresses: args["trusted_addresses"] ?? "",
|
|
509
509
|
untrustedAddresses: args["untrusted_addresses"],
|
|
@@ -518,7 +518,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
520
|
if (tool === "scam_topology") {
|
|
521
|
-
const { scamTopology } = await import("./public-tools-
|
|
521
|
+
const { scamTopology } = await import("./public-tools-DoRNhMn9.mjs");
|
|
522
522
|
const victimAddress = String(args["victim_address"] ?? "").trim();
|
|
523
523
|
if (!victimAddress) throw new Error("victim_address is required");
|
|
524
524
|
const incidentTimestampMs = optionalNumberArg(args["incident_timestamp_ms"], "incident_timestamp_ms");
|
|
@@ -536,7 +536,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
536
536
|
return;
|
|
537
537
|
}
|
|
538
538
|
if (tool === "stake_insights") {
|
|
539
|
-
const { stakeInsights } = await import("./public-tools-
|
|
539
|
+
const { stakeInsights } = await import("./public-tools-DoRNhMn9.mjs");
|
|
540
540
|
const result = await stakeInsights(client, {
|
|
541
541
|
network: String(args["network"] ?? ""),
|
|
542
542
|
address: args["address"] === void 0 ? void 0 : String(args["address"]),
|
package/dist/mcp-proxy.cjs
CHANGED
|
@@ -65,6 +65,11 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
|
65
65
|
graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Cross-layer correlated joins may be limited by the active graph endpoint; preserve full addresses exactly.",
|
|
66
66
|
graph_query_batch: "Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads."
|
|
67
67
|
};
|
|
68
|
+
const FALLBACK_GRAPH_PRIMITIVE_TOOL_NAMES = [
|
|
69
|
+
"network_capabilities",
|
|
70
|
+
"graph_query",
|
|
71
|
+
"graph_query_batch"
|
|
72
|
+
];
|
|
68
73
|
const NETWORK_DESCRIPTION = "Required network to query. Do not guess; use network_capabilities or ask the user if missing.";
|
|
69
74
|
const REMOTE_GRAPH_TOOL_REQUEST_TIMEOUT_MS = 900 * 1e3;
|
|
70
75
|
const CHAIN_INSIGHTS_WORKFLOW = [
|
|
@@ -189,6 +194,12 @@ function knownPublicToolInputSchema(toolName) {
|
|
|
189
194
|
default: return null;
|
|
190
195
|
}
|
|
191
196
|
}
|
|
197
|
+
function fallbackGraphPrimitiveTools() {
|
|
198
|
+
return FALLBACK_GRAPH_PRIMITIVE_TOOL_NAMES.map((name) => ({
|
|
199
|
+
name,
|
|
200
|
+
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[name]
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
192
203
|
function isRecord(value) {
|
|
193
204
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
194
205
|
}
|
|
@@ -594,7 +605,6 @@ async function createProxy() {
|
|
|
594
605
|
graph_mcp_endpoint: resolveGraphMcpEndpoint(config),
|
|
595
606
|
log_path: logger.filePath
|
|
596
607
|
});
|
|
597
|
-
const mcpFetch = await createConfiguredGraphMcpFetch(config);
|
|
598
608
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
599
609
|
const remoteClient = new _modelcontextprotocol_sdk_client_index_js.Client({
|
|
600
610
|
name: "chain-insights-proxy-client",
|
|
@@ -602,7 +612,18 @@ async function createProxy() {
|
|
|
602
612
|
});
|
|
603
613
|
let remoteConnected = false;
|
|
604
614
|
let remoteUnavailableMessage;
|
|
615
|
+
let mcpFetch;
|
|
605
616
|
try {
|
|
617
|
+
mcpFetch = await createConfiguredGraphMcpFetch(config);
|
|
618
|
+
} catch (err) {
|
|
619
|
+
await logger.error("remote.fetch_setup_failed", {
|
|
620
|
+
endpoint: graphMcpEndpoint,
|
|
621
|
+
error: errorForLog(err)
|
|
622
|
+
});
|
|
623
|
+
remoteUnavailableMessage = `Graph MCP setup unavailable at ${graphMcpEndpoint}: ${err.message}`;
|
|
624
|
+
process.stderr.write(`Chain Insights MCP graph tools unavailable: ${remoteUnavailableMessage}. Local Chain Insights tools are still available.\n`);
|
|
625
|
+
}
|
|
626
|
+
if (mcpFetch) try {
|
|
606
627
|
await remoteClient.connect(new _modelcontextprotocol_sdk_client_streamableHttp_js.StreamableHTTPClientTransport(new URL(graphMcpEndpoint), { fetch: mcpFetch }));
|
|
607
628
|
remoteConnected = true;
|
|
608
629
|
await logger.info("remote.connect", {
|
|
@@ -646,10 +667,10 @@ async function createProxy() {
|
|
|
646
667
|
count: tools.length
|
|
647
668
|
});
|
|
648
669
|
else {
|
|
649
|
-
tools =
|
|
670
|
+
tools = fallbackGraphPrimitiveTools();
|
|
650
671
|
await logger.info("schema.tools_loaded", {
|
|
651
672
|
source: "unavailable",
|
|
652
|
-
count:
|
|
673
|
+
count: tools.length
|
|
653
674
|
});
|
|
654
675
|
}
|
|
655
676
|
const remoteToolNames = new Set((tools ?? []).map((tool) => tool.name));
|
|
@@ -995,7 +1016,7 @@ async function createProxy() {
|
|
|
995
1016
|
}],
|
|
996
1017
|
isError: true
|
|
997
1018
|
};
|
|
998
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
1019
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
999
1020
|
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
|
|
1000
1021
|
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-XbN16DwU.cjs"));
|
|
1001
1022
|
const result = await addressRisk(remoteClient, {
|
|
@@ -1066,7 +1087,7 @@ async function createProxy() {
|
|
|
1066
1087
|
}],
|
|
1067
1088
|
isError: true
|
|
1068
1089
|
};
|
|
1069
|
-
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-
|
|
1090
|
+
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
1070
1091
|
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
|
|
1071
1092
|
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-XbN16DwU.cjs"));
|
|
1072
1093
|
const result = await trackFunds(remoteClient, config, {
|
|
@@ -1139,7 +1160,7 @@ async function createProxy() {
|
|
|
1139
1160
|
}],
|
|
1140
1161
|
isError: true
|
|
1141
1162
|
};
|
|
1142
|
-
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-
|
|
1163
|
+
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
1143
1164
|
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
|
|
1144
1165
|
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-XbN16DwU.cjs"));
|
|
1145
1166
|
const result = await scamTopology(remoteClient, config, {
|
|
@@ -1216,7 +1237,7 @@ async function createProxy() {
|
|
|
1216
1237
|
}],
|
|
1217
1238
|
isError: true
|
|
1218
1239
|
};
|
|
1219
|
-
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-
|
|
1240
|
+
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
1220
1241
|
const { writeGraphReport } = await Promise.resolve().then(() => require("./graph-reports-B3mkLP8Z.cjs"));
|
|
1221
1242
|
const { ensureArtifactServer } = await Promise.resolve().then(() => require("./artifact-server-XbN16DwU.cjs"));
|
|
1222
1243
|
const result = await stakeInsights(remoteClient, {
|
package/dist/mcp-proxy.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AAqyBA;;;;AAA4C;;iBAAtB,WAAA,CAAA,GAAe,OAAO"}
|
package/dist/mcp-proxy.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;AAqyBA;;;;AAA4C;;iBAAtB,WAAA,CAAA,GAAe,OAAO"}
|
package/dist/mcp-proxy.mjs
CHANGED
|
@@ -61,6 +61,11 @@ const KNOWN_PUBLIC_TOOL_DESCRIPTIONS = {
|
|
|
61
61
|
graph_query: "Run a read-only GQL/Cypher query through the Chain Insights graph endpoint. Use USE live_topology for recent topology, USE archive_topology for historical topology, and USE facts for labels, features, risk scores, assets, and enrichment. Cross-layer correlated joins may be limited by the active graph endpoint; preserve full addresses exactly.",
|
|
62
62
|
graph_query_batch: "Run multiple read-only GQL/Cypher queries through the Chain Insights graph endpoint in one paid batch. Prefer this for related topology/facts reads."
|
|
63
63
|
};
|
|
64
|
+
const FALLBACK_GRAPH_PRIMITIVE_TOOL_NAMES = [
|
|
65
|
+
"network_capabilities",
|
|
66
|
+
"graph_query",
|
|
67
|
+
"graph_query_batch"
|
|
68
|
+
];
|
|
64
69
|
const NETWORK_DESCRIPTION = "Required network to query. Do not guess; use network_capabilities or ask the user if missing.";
|
|
65
70
|
const REMOTE_GRAPH_TOOL_REQUEST_TIMEOUT_MS = 900 * 1e3;
|
|
66
71
|
const CHAIN_INSIGHTS_WORKFLOW = [
|
|
@@ -185,6 +190,12 @@ function knownPublicToolInputSchema(toolName) {
|
|
|
185
190
|
default: return null;
|
|
186
191
|
}
|
|
187
192
|
}
|
|
193
|
+
function fallbackGraphPrimitiveTools() {
|
|
194
|
+
return FALLBACK_GRAPH_PRIMITIVE_TOOL_NAMES.map((name) => ({
|
|
195
|
+
name,
|
|
196
|
+
description: KNOWN_PUBLIC_TOOL_DESCRIPTIONS[name]
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
188
199
|
function isRecord(value) {
|
|
189
200
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
190
201
|
}
|
|
@@ -590,7 +601,6 @@ async function createProxy() {
|
|
|
590
601
|
graph_mcp_endpoint: resolveGraphMcpEndpoint(config),
|
|
591
602
|
log_path: logger.filePath
|
|
592
603
|
});
|
|
593
|
-
const mcpFetch = await createConfiguredGraphMcpFetch(config);
|
|
594
604
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
595
605
|
const remoteClient = new Client({
|
|
596
606
|
name: "chain-insights-proxy-client",
|
|
@@ -598,7 +608,18 @@ async function createProxy() {
|
|
|
598
608
|
});
|
|
599
609
|
let remoteConnected = false;
|
|
600
610
|
let remoteUnavailableMessage;
|
|
611
|
+
let mcpFetch;
|
|
601
612
|
try {
|
|
613
|
+
mcpFetch = await createConfiguredGraphMcpFetch(config);
|
|
614
|
+
} catch (err) {
|
|
615
|
+
await logger.error("remote.fetch_setup_failed", {
|
|
616
|
+
endpoint: graphMcpEndpoint,
|
|
617
|
+
error: errorForLog(err)
|
|
618
|
+
});
|
|
619
|
+
remoteUnavailableMessage = `Graph MCP setup unavailable at ${graphMcpEndpoint}: ${err.message}`;
|
|
620
|
+
process.stderr.write(`Chain Insights MCP graph tools unavailable: ${remoteUnavailableMessage}. Local Chain Insights tools are still available.\n`);
|
|
621
|
+
}
|
|
622
|
+
if (mcpFetch) try {
|
|
602
623
|
await remoteClient.connect(new StreamableHTTPClientTransport(new URL(graphMcpEndpoint), { fetch: mcpFetch }));
|
|
603
624
|
remoteConnected = true;
|
|
604
625
|
await logger.info("remote.connect", {
|
|
@@ -642,10 +663,10 @@ async function createProxy() {
|
|
|
642
663
|
count: tools.length
|
|
643
664
|
});
|
|
644
665
|
else {
|
|
645
|
-
tools =
|
|
666
|
+
tools = fallbackGraphPrimitiveTools();
|
|
646
667
|
await logger.info("schema.tools_loaded", {
|
|
647
668
|
source: "unavailable",
|
|
648
|
-
count:
|
|
669
|
+
count: tools.length
|
|
649
670
|
});
|
|
650
671
|
}
|
|
651
672
|
const remoteToolNames = new Set((tools ?? []).map((tool) => tool.name));
|
|
@@ -991,7 +1012,7 @@ async function createProxy() {
|
|
|
991
1012
|
}],
|
|
992
1013
|
isError: true
|
|
993
1014
|
};
|
|
994
|
-
const { addressRisk } = await import("./public-tools-
|
|
1015
|
+
const { addressRisk } = await import("./public-tools-DoRNhMn9.mjs");
|
|
995
1016
|
const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
|
|
996
1017
|
const { ensureArtifactServer } = await import("./artifact-server-CP6LXQ9d.mjs");
|
|
997
1018
|
const result = await addressRisk(remoteClient, {
|
|
@@ -1062,7 +1083,7 @@ async function createProxy() {
|
|
|
1062
1083
|
}],
|
|
1063
1084
|
isError: true
|
|
1064
1085
|
};
|
|
1065
|
-
const { trackFunds } = await import("./public-tools-
|
|
1086
|
+
const { trackFunds } = await import("./public-tools-DoRNhMn9.mjs");
|
|
1066
1087
|
const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
|
|
1067
1088
|
const { ensureArtifactServer } = await import("./artifact-server-CP6LXQ9d.mjs");
|
|
1068
1089
|
const result = await trackFunds(remoteClient, config, {
|
|
@@ -1135,7 +1156,7 @@ async function createProxy() {
|
|
|
1135
1156
|
}],
|
|
1136
1157
|
isError: true
|
|
1137
1158
|
};
|
|
1138
|
-
const { scamTopology } = await import("./public-tools-
|
|
1159
|
+
const { scamTopology } = await import("./public-tools-DoRNhMn9.mjs");
|
|
1139
1160
|
const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
|
|
1140
1161
|
const { ensureArtifactServer } = await import("./artifact-server-CP6LXQ9d.mjs");
|
|
1141
1162
|
const result = await scamTopology(remoteClient, config, {
|
|
@@ -1212,7 +1233,7 @@ async function createProxy() {
|
|
|
1212
1233
|
}],
|
|
1213
1234
|
isError: true
|
|
1214
1235
|
};
|
|
1215
|
-
const { stakeInsights } = await import("./public-tools-
|
|
1236
|
+
const { stakeInsights } = await import("./public-tools-DoRNhMn9.mjs");
|
|
1216
1237
|
const { writeGraphReport } = await import("./graph-reports-BDELxmpi.mjs");
|
|
1217
1238
|
const { ensureArtifactServer } = await import("./artifact-server-CP6LXQ9d.mjs");
|
|
1218
1239
|
const result = await stakeInsights(remoteClient, {
|