chain-insights 0.36.0 → 0.37.1
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/{capabilities-B-M8vAYp.cjs → capabilities-BbAQ4Tfa.cjs} +36 -0
- package/dist/{capabilities-ByKP5l0G.mjs → capabilities-C8DQSfyW.mjs} +37 -1
- package/dist/capabilities-C8DQSfyW.mjs.map +1 -0
- package/dist/cli.cjs +5 -5
- package/dist/cli.mjs +5 -5
- package/dist/mcp-proxy.cjs +3 -2
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +3 -2
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-rKIzmn6f.mjs → public-tools-CYNhQm82.mjs} +2 -4
- package/dist/public-tools-CYNhQm82.mjs.map +1 -0
- package/dist/{public-tools-C6QY_gam.cjs → public-tools-cRhdWVRY.cjs} +1 -3
- package/package.json +1 -1
- package/dist/capabilities-ByKP5l0G.mjs.map +0 -1
- package/dist/public-tools-rKIzmn6f.mjs.map +0 -1
|
@@ -19,6 +19,38 @@ function advertisedTools(raw) {
|
|
|
19
19
|
for (const [name, status] of Object.entries(raw)) if (name.trim() !== "" && typeof status === "string") tools[name] = status;
|
|
20
20
|
return tools;
|
|
21
21
|
}
|
|
22
|
+
function advertisedLaneProgress(raw) {
|
|
23
|
+
if (!Array.isArray(raw)) return void 0;
|
|
24
|
+
const lanes = [];
|
|
25
|
+
for (const entry of raw) {
|
|
26
|
+
if (!isRecord(entry) || typeof entry.lane !== "string" || entry.lane.trim() === "") continue;
|
|
27
|
+
if (typeof entry.height === "number") lanes.push({
|
|
28
|
+
lane: entry.lane,
|
|
29
|
+
height: entry.height
|
|
30
|
+
});
|
|
31
|
+
else if (entry.height === null) lanes.push({
|
|
32
|
+
lane: entry.lane,
|
|
33
|
+
height: null
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return lanes;
|
|
37
|
+
}
|
|
38
|
+
function advertisedGraphProgress(raw) {
|
|
39
|
+
if (!isRecord(raw) || typeof raw.complete_through_block !== "number") return void 0;
|
|
40
|
+
if (!Array.isArray(raw.layers)) return void 0;
|
|
41
|
+
const layers = [];
|
|
42
|
+
for (const entry of raw.layers) {
|
|
43
|
+
if (!isRecord(entry) || typeof entry.layer !== "string" || typeof entry.position !== "number") continue;
|
|
44
|
+
layers.push({
|
|
45
|
+
layer: entry.layer,
|
|
46
|
+
position: entry.position
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
complete_through_block: raw.complete_through_block,
|
|
51
|
+
layers
|
|
52
|
+
};
|
|
53
|
+
}
|
|
22
54
|
function advertisedNetwork(raw) {
|
|
23
55
|
if (!isRecord(raw) || typeof raw.network !== "string" || raw.network.trim() === "") return null;
|
|
24
56
|
const network = raw.network.trim();
|
|
@@ -33,6 +65,10 @@ function advertisedNetwork(raw) {
|
|
|
33
65
|
if (raw.default === false) capability.default = false;
|
|
34
66
|
if (isRecord(raw.coverage)) capability.coverage = raw.coverage;
|
|
35
67
|
if (isRecord(raw.freshness)) capability.freshness = raw.freshness;
|
|
68
|
+
const laneProgress = advertisedLaneProgress(raw.lane_progress);
|
|
69
|
+
if (laneProgress) capability.lane_progress = laneProgress;
|
|
70
|
+
const graphProgress = advertisedGraphProgress(raw.graph_progress);
|
|
71
|
+
if (graphProgress) capability.graph_progress = graphProgress;
|
|
36
72
|
return capability;
|
|
37
73
|
}
|
|
38
74
|
/** Repeat GraphRAG's network list. CIA does not add, drop, or invent names. */
|
|
@@ -19,6 +19,38 @@ function advertisedTools(raw) {
|
|
|
19
19
|
for (const [name, status] of Object.entries(raw)) if (name.trim() !== "" && typeof status === "string") tools[name] = status;
|
|
20
20
|
return tools;
|
|
21
21
|
}
|
|
22
|
+
function advertisedLaneProgress(raw) {
|
|
23
|
+
if (!Array.isArray(raw)) return void 0;
|
|
24
|
+
const lanes = [];
|
|
25
|
+
for (const entry of raw) {
|
|
26
|
+
if (!isRecord(entry) || typeof entry.lane !== "string" || entry.lane.trim() === "") continue;
|
|
27
|
+
if (typeof entry.height === "number") lanes.push({
|
|
28
|
+
lane: entry.lane,
|
|
29
|
+
height: entry.height
|
|
30
|
+
});
|
|
31
|
+
else if (entry.height === null) lanes.push({
|
|
32
|
+
lane: entry.lane,
|
|
33
|
+
height: null
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return lanes;
|
|
37
|
+
}
|
|
38
|
+
function advertisedGraphProgress(raw) {
|
|
39
|
+
if (!isRecord(raw) || typeof raw.complete_through_block !== "number") return void 0;
|
|
40
|
+
if (!Array.isArray(raw.layers)) return void 0;
|
|
41
|
+
const layers = [];
|
|
42
|
+
for (const entry of raw.layers) {
|
|
43
|
+
if (!isRecord(entry) || typeof entry.layer !== "string" || typeof entry.position !== "number") continue;
|
|
44
|
+
layers.push({
|
|
45
|
+
layer: entry.layer,
|
|
46
|
+
position: entry.position
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
complete_through_block: raw.complete_through_block,
|
|
51
|
+
layers
|
|
52
|
+
};
|
|
53
|
+
}
|
|
22
54
|
function advertisedNetwork(raw) {
|
|
23
55
|
if (!isRecord(raw) || typeof raw.network !== "string" || raw.network.trim() === "") return null;
|
|
24
56
|
const network = raw.network.trim();
|
|
@@ -33,6 +65,10 @@ function advertisedNetwork(raw) {
|
|
|
33
65
|
if (raw.default === false) capability.default = false;
|
|
34
66
|
if (isRecord(raw.coverage)) capability.coverage = raw.coverage;
|
|
35
67
|
if (isRecord(raw.freshness)) capability.freshness = raw.freshness;
|
|
68
|
+
const laneProgress = advertisedLaneProgress(raw.lane_progress);
|
|
69
|
+
if (laneProgress) capability.lane_progress = laneProgress;
|
|
70
|
+
const graphProgress = advertisedGraphProgress(raw.graph_progress);
|
|
71
|
+
if (graphProgress) capability.graph_progress = graphProgress;
|
|
36
72
|
return capability;
|
|
37
73
|
}
|
|
38
74
|
/** Repeat GraphRAG's network list. CIA does not add, drop, or invent names. */
|
|
@@ -160,4 +196,4 @@ function formatNetworkCapability(network) {
|
|
|
160
196
|
//#endregion
|
|
161
197
|
export { mirrorGraphNetworkCapabilities as n, capabilities_exports as t };
|
|
162
198
|
|
|
163
|
-
//# sourceMappingURL=capabilities-
|
|
199
|
+
//# sourceMappingURL=capabilities-C8DQSfyW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities-C8DQSfyW.mjs","names":[],"sources":["../src/mcp/capabilities.ts"],"sourcesContent":["import type { InvestigatorConfig } from '../config/schema.js'\nimport { applyMcpAuthHeaders, resolveGraphMcpEndpoint } from './client.js'\n\nexport interface NetworkTopologyLayer {\n enabled: boolean\n coverage?: {\n from_block?: number\n to_block?: number\n from_timestamp?: string\n to_timestamp?: string\n chain_tip_block?: number\n blocks_behind_tip?: number\n /** Lowest height among the raw-data lanes that have started. Above it an empty answer may mean \"not indexed yet\". */\n complete_through_block?: number\n }\n}\n\nexport interface NetworkLayerCapability {\n enabled: boolean\n live?: NetworkTopologyLayer\n archive?: NetworkTopologyLayer\n}\n\nexport interface NetworkCapability {\n network: string\n display_name?: string\n status: string\n default?: boolean\n layers: Record<string, NetworkLayerCapability>\n tools: Record<string, string>\n coverage?: {\n from_block?: number\n to_block?: number\n from_timestamp?: string\n to_timestamp?: string\n chain_tip_block?: number\n blocks_behind_tip?: number\n /** Lowest height among the raw-data lanes that have started. Above it an empty answer may mean \"not indexed yet\". */\n complete_through_block?: number\n }\n freshness?: {\n last_processed_at?: string\n last_successful_sync_at?: string\n max_data_age_seconds?: number\n last_processing_duration_seconds?: number\n }\n lane_progress?: NetworkLaneProgress[]\n graph_progress?: NetworkGraphProgress\n}\n\n/** One writer lane's committed height. null: the lane has not started. */\nexport interface NetworkLaneProgress {\n lane: string\n height: number | null\n}\n\n/** How far each block layer of the topology graph reaches, and their lowest. */\nexport interface NetworkGraphProgress {\n complete_through_block: number\n layers: { layer: string; position: number }[]\n}\n\nexport interface NetworkCapabilitiesDocument {\n schema: 'chain-insights.network-capabilities.v1'\n networks: NetworkCapability[]\n}\n\nconst AVAILABLE_TOOLS_PER_LINE = 3\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction advertisedTools(raw: unknown): Record<string, string> {\n if (!isRecord(raw)) return {}\n const tools: Record<string, string> = {}\n for (const [name, status] of Object.entries(raw)) {\n if (name.trim() !== '' && typeof status === 'string') tools[name] = status\n }\n return tools\n}\n\nfunction advertisedLaneProgress(raw: unknown): NetworkLaneProgress[] | undefined {\n if (!Array.isArray(raw)) return undefined\n const lanes: NetworkLaneProgress[] = []\n for (const entry of raw) {\n if (!isRecord(entry) || typeof entry.lane !== 'string' || entry.lane.trim() === '') continue\n if (typeof entry.height === 'number') lanes.push({ lane: entry.lane, height: entry.height })\n else if (entry.height === null) lanes.push({ lane: entry.lane, height: null })\n }\n return lanes\n}\n\nfunction advertisedGraphProgress(raw: unknown): NetworkGraphProgress | undefined {\n if (!isRecord(raw) || typeof raw.complete_through_block !== 'number') return undefined\n if (!Array.isArray(raw.layers)) return undefined\n const layers: NetworkGraphProgress['layers'] = []\n for (const entry of raw.layers) {\n if (!isRecord(entry) || typeof entry.layer !== 'string' || typeof entry.position !== 'number')\n continue\n layers.push({ layer: entry.layer, position: entry.position })\n }\n return { complete_through_block: raw.complete_through_block, layers }\n}\n\nfunction advertisedNetwork(raw: unknown): NetworkCapability | null {\n if (!isRecord(raw) || typeof raw.network !== 'string' || raw.network.trim() === '') {\n return null\n }\n const network = raw.network.trim()\n const capability: NetworkCapability = {\n network,\n display_name:\n typeof raw.display_name === 'string' && raw.display_name.trim() !== ''\n ? raw.display_name\n : network,\n status: typeof raw.status === 'string' && raw.status.trim() !== '' ? raw.status : 'live',\n layers: {},\n tools: advertisedTools(raw.tools),\n }\n if (raw.default === true) capability.default = true\n if (raw.default === false) capability.default = false\n if (isRecord(raw.coverage)) capability.coverage = raw.coverage as NetworkCapability['coverage']\n if (isRecord(raw.freshness))\n capability.freshness = raw.freshness as NetworkCapability['freshness']\n const laneProgress = advertisedLaneProgress(raw.lane_progress)\n if (laneProgress) capability.lane_progress = laneProgress\n const graphProgress = advertisedGraphProgress(raw.graph_progress)\n if (graphProgress) capability.graph_progress = graphProgress\n return capability\n}\n\n/** Repeat GraphRAG's network list. CIA does not add, drop, or invent names. */\nexport function mirrorGraphNetworkCapabilities(document: {\n networks: unknown[]\n}): NetworkCapabilitiesDocument {\n return {\n schema: 'chain-insights.network-capabilities.v1',\n networks: document.networks\n .map((network) => advertisedNetwork(network))\n .filter((network): network is NetworkCapability => network !== null),\n }\n}\n\nfunction publicNetworkCapabilities(\n document: NetworkCapabilitiesDocument\n): NetworkCapabilitiesDocument {\n return mirrorGraphNetworkCapabilities(document)\n}\n\nfunction metadataNetworksUrl(endpoint: string): URL {\n const url = new URL(endpoint)\n url.pathname = '/metadata/networks'\n url.search = ''\n url.hash = ''\n return url\n}\n\nexport async function fetchNetworkCapabilities(\n config: Pick<InvestigatorConfig, 'graphMcpAuthToken' | 'graphMcpMode' | 'graphMcpEndpoint'>\n): Promise<NetworkCapabilitiesDocument> {\n const endpoint = resolveGraphMcpEndpoint(config)\n const request = metadataNetworksUrl(endpoint)\n const headers = new Headers()\n const token = config.graphMcpAuthToken?.trim()\n if (token) {\n applyMcpAuthHeaders(headers, token)\n }\n let response: Response\n try {\n response = await fetch(request, { headers })\n } catch (err) {\n throw new Error(`network capabilities unavailable at ${request}: ${(err as Error).message}`)\n }\n if (!response.ok) {\n throw new Error(`network capabilities unavailable at ${request}: HTTP ${response.status}`)\n }\n const parsed = (await response.json()) as NetworkCapabilitiesDocument\n if (\n parsed.schema !== 'chain-insights.network-capabilities.v1' ||\n !Array.isArray(parsed.networks)\n ) {\n throw new Error('network capabilities response has unsupported schema')\n }\n return publicNetworkCapabilities(parsed)\n}\n\nfunction availableTools(network: NetworkCapability): string[] {\n const tools = Object.entries(network.tools ?? {})\n .filter(([, status]) => status === 'available')\n .map(([name]) => name)\n return tools.sort()\n}\n\nfunction availableToolLines(network: NetworkCapability): string[] {\n const tools = availableTools(network)\n if (tools.length === 0) return ['none']\n const lines: string[] = []\n for (let index = 0; index < tools.length; index += AVAILABLE_TOOLS_PER_LINE) {\n lines.push(tools.slice(index, index + AVAILABLE_TOOLS_PER_LINE).join(', '))\n }\n return lines\n}\n\nfunction shortDate(value?: string): string {\n if (!value) return ''\n return value.slice(0, 10)\n}\n\nfunction datasetLabel(network: NetworkCapability): string {\n const coverage = network.coverage\n if (!coverage) return 'unknown'\n const blockRange =\n coverage.from_block !== undefined && coverage.to_block !== undefined\n ? `${coverage.from_block}..${coverage.to_block}`\n : 'blocks unknown'\n const dateRange =\n coverage.from_timestamp && coverage.to_timestamp\n ? `${shortDate(coverage.from_timestamp)}..${shortDate(coverage.to_timestamp)}`\n : ''\n if (blockRange === 'blocks unknown' && dateRange === '') return 'unknown'\n if (blockRange === 'blocks unknown') return dateRange\n if (dateRange === '') return blockRange\n return `${blockRange} / ${dateRange}`\n}\n\nfunction displayName(network: NetworkCapability): string {\n return network.display_name || network.network\n}\n\nfunction statusLabel(network: NetworkCapability): string {\n return network.default ? `${network.status} (default)` : network.status\n}\n\nfunction formatTable(headers: string[], rows: string[][], minimumWidths: number[]): string {\n const widths = headers.map((header, index) =>\n Math.max(\n minimumWidths[index] ?? 0,\n header.length,\n ...rows.map((row) => row[index]?.length ?? 0)\n )\n )\n const row = (values: string[]) =>\n values.map((value, index) => value.padEnd(widths[index]!)).join(' ')\n return [row(headers), widths.map((width) => '-'.repeat(width)).join(' '), ...rows.map(row)].join(\n '\\n'\n )\n}\n\nexport function formatNetworkOverview(document: NetworkCapabilitiesDocument): string {\n if (document.networks.length === 0) return 'No supported networks advertised.'\n const rows = document.networks.map((network) => [\n displayName(network),\n statusLabel(network),\n datasetLabel(network),\n ])\n return formatTable(['Network', 'Status', 'Dataset'], rows, [14, 10, 38])\n}\n\nexport function formatNetworkCapabilities(document: NetworkCapabilitiesDocument): string {\n if (document.networks.length === 0) return 'No supported networks advertised.'\n const networkRows = document.networks.flatMap((network) => {\n const toolLines = availableToolLines(network)\n return toolLines.map((toolLine, index) => [\n index === 0 ? displayName(network) : '',\n index === 0 ? datasetLabel(network) : '',\n toolLine,\n ])\n })\n return formatTable(['Network', 'Dataset', 'Chain Insights tools'], networkRows, [14, 38, 64])\n}\n\nexport function findNetworkCapability(\n document: NetworkCapabilitiesDocument,\n name: string\n): NetworkCapability | undefined {\n const normalizedName = name.trim().toLowerCase()\n if (!normalizedName) return undefined\n return document.networks.find((network) =>\n [network.network, network.display_name].some(\n (candidate) => candidate?.trim().toLowerCase() === normalizedName\n )\n )\n}\n\nexport function formatNetworkCapability(network: NetworkCapability): string {\n const rows = [\n ['Network', network.display_name || network.network],\n ['Identifier', network.network],\n ['Status', network.default ? `${network.status} (default)` : network.status],\n ['Dataset', datasetLabel(network)],\n ['Available tools', availableTools(network).join(', ') || 'none'],\n ]\n const labelWidth = Math.max(...rows.map(([label]) => label.length))\n return rows.map(([label, value]) => `${label.padEnd(labelWidth)} ${value}`).join('\\n')\n}\n"],"mappings":";;;;;;;;;;;AAmEA,MAAM,2BAA2B;AAEjC,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,gBAAgB,KAAsC;CAC7D,IAAI,CAAC,SAAS,GAAG,GAAG,OAAO,CAAC;CAC5B,MAAM,QAAgC,CAAC;CACvC,KAAK,MAAM,CAAC,MAAM,WAAW,OAAO,QAAQ,GAAG,GAC7C,IAAI,KAAK,KAAK,MAAM,MAAM,OAAO,WAAW,UAAU,MAAM,QAAQ;CAEtE,OAAO;AACT;AAEA,SAAS,uBAAuB,KAAiD;CAC/E,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,OAAO,KAAA;CAChC,MAAM,QAA+B,C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AC,YAAY,MAAM,cACrD,CACF;AACF;AAEA,SAAgB,wBAAwB,SAAoC;CAC1E,MAAM,OAAO;EACX,CAAC,WAAW,QAAQ,gBAAgB,QAAQ,OAAO;EACnD,CAAC,cAAc,QAAQ,OAAO;EAC9B,CAAC,UAAU,QAAQ,UAAU,GAAG,QAAQ,OAAO,cAAc,QAAQ,MAAM;EAC3E,CAAC,WAAW,aAAa,OAAO,CAAC;EACjC,CAAC,mBAAmB,eAAe,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,MAAM;CAClE;CACA,MAAM,aAAa,KAAK,IAAI,GAAG,KAAK,KAAK,CAAC,WAAW,MAAM,MAAM,CAAC;CAClE,OAAO,KAAK,KAAK,CAAC,OAAO,WAAW,GAAG,MAAM,OAAO,UAAU,EAAE,IAAI,OAAO,CAAC,CAAC,KAAK,IAAI;AACxF"}
|
package/dist/cli.cjs
CHANGED
|
@@ -213,21 +213,21 @@ async function withGraphMcpClient(name, fn) {
|
|
|
213
213
|
}
|
|
214
214
|
async function printNetworkCapabilities(opts) {
|
|
215
215
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
216
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-
|
|
216
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-BbAQ4Tfa.cjs")).then((n) => n.capabilities_exports);
|
|
217
217
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
218
218
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
219
219
|
else console.log(formatNetworkCapabilities(document));
|
|
220
220
|
}
|
|
221
221
|
async function printNetworkOverview(opts) {
|
|
222
222
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
223
|
-
const { fetchNetworkCapabilities, formatNetworkOverview } = await Promise.resolve().then(() => require("./capabilities-
|
|
223
|
+
const { fetchNetworkCapabilities, formatNetworkOverview } = await Promise.resolve().then(() => require("./capabilities-BbAQ4Tfa.cjs")).then((n) => n.capabilities_exports);
|
|
224
224
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
225
225
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
226
226
|
else console.log(formatNetworkOverview(document));
|
|
227
227
|
}
|
|
228
228
|
async function printNetworkCapability(name, opts) {
|
|
229
229
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
230
|
-
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await Promise.resolve().then(() => require("./capabilities-
|
|
230
|
+
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await Promise.resolve().then(() => require("./capabilities-BbAQ4Tfa.cjs")).then((n) => n.capabilities_exports);
|
|
231
231
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
232
232
|
const network = findNetworkCapability(document, name);
|
|
233
233
|
if (!network) {
|
|
@@ -301,11 +301,11 @@ async function printSubscriptionPassGuidance(pass) {
|
|
|
301
301
|
function addAmlAddressRiskCommand(parent, networksCommand) {
|
|
302
302
|
parent.addCommand(createCliCommand("aml-address-risk").description("CIA workflow: screen an address for AML risk, exchange behavior, and optional comparison with another address").requiredOption("--address <address>", "Full blockchain address to screen").requiredOption("--network <network>", `Network to query. Run \`${networksCommand}\` for supported networks.`).option("--compare-address <address>", "Optional second address to compare against the screened address").option("--json", "Print machine-readable JSON output").option("--version <version>", "AML tool contract version. Omit to use the latest version (currently v1)").addOption(new commander.Option("--tool-version <version>", "Internal alias for the AML tool version").hideHelp()).action(async (opts) => {
|
|
303
303
|
try {
|
|
304
|
-
const { resolveAmlAddressRiskVersion } = await Promise.resolve().then(() => require("./public-tools-
|
|
304
|
+
const { resolveAmlAddressRiskVersion } = await Promise.resolve().then(() => require("./public-tools-cRhdWVRY.cjs"));
|
|
305
305
|
const requestedVersion = opts.toolVersion ?? opts.version;
|
|
306
306
|
resolveAmlAddressRiskVersion(requestedVersion);
|
|
307
307
|
await withGraphMcpClient("chain-insights-cli-aml-address-risk", async (client) => {
|
|
308
|
-
const { runAmlAddressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
308
|
+
const { runAmlAddressRisk } = await Promise.resolve().then(() => require("./public-tools-cRhdWVRY.cjs"));
|
|
309
309
|
const result = await runAmlAddressRisk(client, {
|
|
310
310
|
address: opts.address,
|
|
311
311
|
network: opts.network,
|
package/dist/cli.mjs
CHANGED
|
@@ -211,21 +211,21 @@ async function withGraphMcpClient(name, fn) {
|
|
|
211
211
|
}
|
|
212
212
|
async function printNetworkCapabilities(opts) {
|
|
213
213
|
const { loadConfig } = await import("./config-DbbPiGk0.mjs").then((n) => n.t);
|
|
214
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-
|
|
214
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-C8DQSfyW.mjs").then((n) => n.t);
|
|
215
215
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
216
216
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
217
217
|
else console.log(formatNetworkCapabilities(document));
|
|
218
218
|
}
|
|
219
219
|
async function printNetworkOverview(opts) {
|
|
220
220
|
const { loadConfig } = await import("./config-DbbPiGk0.mjs").then((n) => n.t);
|
|
221
|
-
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-
|
|
221
|
+
const { fetchNetworkCapabilities, formatNetworkOverview } = await import("./capabilities-C8DQSfyW.mjs").then((n) => n.t);
|
|
222
222
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
223
223
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
224
224
|
else console.log(formatNetworkOverview(document));
|
|
225
225
|
}
|
|
226
226
|
async function printNetworkCapability(name, opts) {
|
|
227
227
|
const { loadConfig } = await import("./config-DbbPiGk0.mjs").then((n) => n.t);
|
|
228
|
-
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-
|
|
228
|
+
const { fetchNetworkCapabilities, findNetworkCapability, formatNetworkCapability } = await import("./capabilities-C8DQSfyW.mjs").then((n) => n.t);
|
|
229
229
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
230
230
|
const network = findNetworkCapability(document, name);
|
|
231
231
|
if (!network) {
|
|
@@ -299,11 +299,11 @@ async function printSubscriptionPassGuidance(pass) {
|
|
|
299
299
|
function addAmlAddressRiskCommand(parent, networksCommand) {
|
|
300
300
|
parent.addCommand(createCliCommand("aml-address-risk").description("CIA workflow: screen an address for AML risk, exchange behavior, and optional comparison with another address").requiredOption("--address <address>", "Full blockchain address to screen").requiredOption("--network <network>", `Network to query. Run \`${networksCommand}\` for supported networks.`).option("--compare-address <address>", "Optional second address to compare against the screened address").option("--json", "Print machine-readable JSON output").option("--version <version>", "AML tool contract version. Omit to use the latest version (currently v1)").addOption(new Option("--tool-version <version>", "Internal alias for the AML tool version").hideHelp()).action(async (opts) => {
|
|
301
301
|
try {
|
|
302
|
-
const { resolveAmlAddressRiskVersion } = await import("./public-tools-
|
|
302
|
+
const { resolveAmlAddressRiskVersion } = await import("./public-tools-CYNhQm82.mjs");
|
|
303
303
|
const requestedVersion = opts.toolVersion ?? opts.version;
|
|
304
304
|
resolveAmlAddressRiskVersion(requestedVersion);
|
|
305
305
|
await withGraphMcpClient("chain-insights-cli-aml-address-risk", async (client) => {
|
|
306
|
-
const { runAmlAddressRisk } = await import("./public-tools-
|
|
306
|
+
const { runAmlAddressRisk } = await import("./public-tools-CYNhQm82.mjs");
|
|
307
307
|
const result = await runAmlAddressRisk(client, {
|
|
308
308
|
address: opts.address,
|
|
309
309
|
network: opts.network,
|
package/dist/mcp-proxy.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const require_client = require("./client-Ypw9BNbn.cjs");
|
|
|
5
5
|
const require_tool_visibility = require("./tool-visibility-CyZqYnQA.cjs");
|
|
6
6
|
const require_usage_status = require("./usage-status-BdwwgYsu.cjs");
|
|
7
7
|
const require_subscription_status = require("./subscription-status-Cm7LqY_h.cjs");
|
|
8
|
-
const require_capabilities = require("./capabilities-
|
|
8
|
+
const require_capabilities = require("./capabilities-BbAQ4Tfa.cjs");
|
|
9
9
|
const require_action_log = require("./action-log-HniMMF7f.cjs");
|
|
10
10
|
let node_path = require("node:path");
|
|
11
11
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -61,6 +61,7 @@ const CHAIN_INSIGHTS_WORKFLOW = [
|
|
|
61
61
|
const GRAPH_SCHEMA_HINTS = [
|
|
62
62
|
"Graph query hints:",
|
|
63
63
|
"- Call meta_network_capabilities first. Pass network= exactly as GraphRAG advertised it. CIA does not pick a default network.",
|
|
64
|
+
"- Coverage is per kind of data. coverage.complete_through_block is the floor of USE facts: below it every raw relationship is indexed. graph_progress.complete_through_block is the floor of USE topology, and graph_progress.layers gives each link kind its own height. An empty answer above the floor may mean not indexed yet, not absent on chain. An absent chain_tip_block means the indexers are catching up: read freshness.max_data_age_seconds for the lag.",
|
|
64
65
|
"- The graph is address-grain. The only topology money node label is Address, keyed by the raw chain-native H160 address on EVM networks, for example 0x1874a43d7c6d888f9eda3d22a3a49704e3cadb24. The network value on Address nodes matches the tool argument. There is no separate identity key.",
|
|
65
66
|
"- Address nodes carry address, network, labels, and the role flags is_exchange, is_scam, is_victim and is_sanctioned. (:Address)-[:LINKED]-(:Address) is an undirected ownership-overlay edge (basis derived/associated, plus confidence, source_event, declared_owner) asserting the two addresses are controlled by the same actor. LINKED is served on the topology graph only. Enumerate LINKED neighbors with MATCH (a:Address {address: $addr})-[l:LINKED]-(b:Address) RETURN b.address, b.network, l.basis, l.confidence.",
|
|
66
67
|
"- Labels hold role words, never detector names: Exchange (plus the exchange name), Scam, Victim and Sanctioned (plus the entity name). Each role is also a node label and a flag on the Address: :Exchange and is_exchange follow the exchange label, :Scam and is_scam the risk label, :Victim and is_victim the protection label, :Sanctioned and is_sanctioned the sanctioned label. Each flag is present only when true and absent otherwise, never false: test IS NOT NULL or IS NULL, not = false. A withdrawn label removes its node label and its flag.",
|
|
@@ -768,7 +769,7 @@ async function createProxy() {
|
|
|
768
769
|
}],
|
|
769
770
|
isError: true
|
|
770
771
|
};
|
|
771
|
-
const { runAmlAddressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
772
|
+
const { runAmlAddressRisk } = await Promise.resolve().then(() => require("./public-tools-cRhdWVRY.cjs"));
|
|
772
773
|
const result = await runAmlAddressRisk(remoteClient, {
|
|
773
774
|
address,
|
|
774
775
|
network,
|
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":";;YA+BY;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;KA2BtE,iBAAiB,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.cts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;YA+BY;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;KA2BtE,iBAAiB,eAAe,EAAE;wBAsEvB,2BAA2B,mBAAmB;;;;;;;;wBAwlBxC,eAAe"}
|
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":";;YA+BY;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;KA2BtE,iBAAiB,eAAe,EAAE;
|
|
1
|
+
{"version":3,"file":"mcp-proxy.d.mts","names":[],"sources":["../src/mcp/proxy.ts"],"mappings":";;YA+BY;wBAEI,oBAAoB,MAAK,OAAO,aAA2B;KA2BtE,iBAAiB,eAAe,EAAE;wBAsEvB,2BAA2B,mBAAmB;;;;;;;;wBAwlBxC,eAAe"}
|
package/dist/mcp-proxy.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { t as PaymentRequiredError } from "./client-CHYskPnG.mjs";
|
|
|
3
3
|
import { n as PUBLIC_MCP_TOOL_ALLOWED_ARGS, r as PUBLIC_MCP_TOOL_REQUIRED_ARGS, t as HIDDEN_REMOTE_TOOL_NAMES } from "./tool-visibility-CJV9HezW.mjs";
|
|
4
4
|
import { t as primitiveBackendUsageStatus } from "./usage-status-CHiOPA-2.mjs";
|
|
5
5
|
import { n as unavailableSubscriptionStatus } from "./subscription-status-MyeqOmbA.mjs";
|
|
6
|
-
import { n as mirrorGraphNetworkCapabilities } from "./capabilities-
|
|
6
|
+
import { n as mirrorGraphNetworkCapabilities } from "./capabilities-C8DQSfyW.mjs";
|
|
7
7
|
import { r as appendActionLog, t as actionLogSignalsFromResult } from "./action-log-diTHyMbV.mjs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { appendFile, mkdir } from "node:fs/promises";
|
|
@@ -57,6 +57,7 @@ const CHAIN_INSIGHTS_WORKFLOW = [
|
|
|
57
57
|
const GRAPH_SCHEMA_HINTS = [
|
|
58
58
|
"Graph query hints:",
|
|
59
59
|
"- Call meta_network_capabilities first. Pass network= exactly as GraphRAG advertised it. CIA does not pick a default network.",
|
|
60
|
+
"- Coverage is per kind of data. coverage.complete_through_block is the floor of USE facts: below it every raw relationship is indexed. graph_progress.complete_through_block is the floor of USE topology, and graph_progress.layers gives each link kind its own height. An empty answer above the floor may mean not indexed yet, not absent on chain. An absent chain_tip_block means the indexers are catching up: read freshness.max_data_age_seconds for the lag.",
|
|
60
61
|
"- The graph is address-grain. The only topology money node label is Address, keyed by the raw chain-native H160 address on EVM networks, for example 0x1874a43d7c6d888f9eda3d22a3a49704e3cadb24. The network value on Address nodes matches the tool argument. There is no separate identity key.",
|
|
61
62
|
"- Address nodes carry address, network, labels, and the role flags is_exchange, is_scam, is_victim and is_sanctioned. (:Address)-[:LINKED]-(:Address) is an undirected ownership-overlay edge (basis derived/associated, plus confidence, source_event, declared_owner) asserting the two addresses are controlled by the same actor. LINKED is served on the topology graph only. Enumerate LINKED neighbors with MATCH (a:Address {address: $addr})-[l:LINKED]-(b:Address) RETURN b.address, b.network, l.basis, l.confidence.",
|
|
62
63
|
"- Labels hold role words, never detector names: Exchange (plus the exchange name), Scam, Victim and Sanctioned (plus the entity name). Each role is also a node label and a flag on the Address: :Exchange and is_exchange follow the exchange label, :Scam and is_scam the risk label, :Victim and is_victim the protection label, :Sanctioned and is_sanctioned the sanctioned label. Each flag is present only when true and absent otherwise, never false: test IS NOT NULL or IS NULL, not = false. A withdrawn label removes its node label and its flag.",
|
|
@@ -764,7 +765,7 @@ async function createProxy() {
|
|
|
764
765
|
}],
|
|
765
766
|
isError: true
|
|
766
767
|
};
|
|
767
|
-
const { runAmlAddressRisk } = await import("./public-tools-
|
|
768
|
+
const { runAmlAddressRisk } = await import("./public-tools-CYNhQm82.mjs");
|
|
768
769
|
const result = await runAmlAddressRisk(remoteClient, {
|
|
769
770
|
address,
|
|
770
771
|
network,
|