chain-insights 0.2.23 → 0.2.25
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/README.md +2 -1
- package/dist/{capabilities-Bm0JDbV7.cjs → capabilities-B4hvro_I.cjs} +1 -1
- package/dist/{capabilities-BShqspb-.mjs → capabilities-mXm_rCe8.mjs} +2 -2
- package/dist/{capabilities-BShqspb-.mjs.map → capabilities-mXm_rCe8.mjs.map} +1 -1
- package/dist/cli.cjs +32 -16
- package/dist/cli.mjs +32 -16
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-DPc2eyVN.cjs → client-BYnFGA0y.cjs} +45 -10
- package/dist/{client-D4_hd4AP.mjs → client-Dl-uHrh1.mjs} +46 -11
- package/dist/client-Dl-uHrh1.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-4tn7jfhN.mjs → init-CB_ga4_8.mjs} +2 -2
- package/dist/init-CB_ga4_8.mjs.map +1 -0
- package/dist/{init-TCQY5RDJ.cjs → init-jhOZ_RvC.cjs} +1 -1
- package/dist/mcp-proxy.cjs +8 -8
- package/dist/mcp-proxy.mjs +8 -8
- 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/dist/{runner-DIs04IhN.mjs → runner-BBH5Ks6q.mjs} +2 -2
- package/dist/{runner-DIs04IhN.mjs.map → runner-BBH5Ks6q.mjs.map} +1 -1
- package/dist/{runner-ZYowxCVl.cjs → runner-e9slg6R2.cjs} +1 -1
- package/dist/tools-D6RBAhSX.mjs +298 -0
- package/dist/tools-D6RBAhSX.mjs.map +1 -0
- package/dist/tools-UH5hRXYG.cjs +343 -0
- package/dist/topup-server-BJgVw6Jt.mjs.map +1 -1
- package/docs/mcp-proxy.md +4 -2
- package/package.json +1 -1
- package/dist/client-D4_hd4AP.mjs.map +0 -1
- package/dist/init-4tn7jfhN.mjs.map +0 -1
- package/dist/public-tools-w7En2m3q.mjs.map +0 -1
- package/dist/tools-DY8h0WbE.cjs +0 -139
- package/dist/tools-Py6SXg6J.mjs +0 -100
- package/dist/tools-Py6SXg6J.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -72,7 +72,8 @@ cia config set graphMcpEndpoint https://staging-mcp.chain-insights.ai/mcp
|
|
|
72
72
|
|
|
73
73
|
Hosted access also needs an access mode, such as an approved access key or a
|
|
74
74
|
prepared wallet. Keep those credentials out of README examples; setup commands
|
|
75
|
-
live in [MCP proxy](docs/mcp-proxy.md).
|
|
75
|
+
live in [MCP proxy](docs/mcp-proxy.md). For paid access, run
|
|
76
|
+
`cia wallet ready`; it checks funding and finishes one-time payment setup.
|
|
76
77
|
|
|
77
78
|
Optional one-shot override from the environment:
|
|
78
79
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as resolveGraphMcpEndpoint } from "./client-
|
|
1
|
+
import { a as resolveGraphMcpEndpoint } from "./client-Dl-uHrh1.mjs";
|
|
2
2
|
//#region src/mcp/capabilities.ts
|
|
3
3
|
function metadataNetworksUrl(endpoint) {
|
|
4
4
|
const url = new URL(endpoint);
|
|
@@ -81,4 +81,4 @@ function formatNetworkCapabilities(document) {
|
|
|
81
81
|
//#endregion
|
|
82
82
|
export { fetchNetworkCapabilities, formatNetworkCapabilities };
|
|
83
83
|
|
|
84
|
-
//# sourceMappingURL=capabilities-
|
|
84
|
+
//# sourceMappingURL=capabilities-mXm_rCe8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities-
|
|
1
|
+
{"version":3,"file":"capabilities-mXm_rCe8.mjs","names":[],"sources":["../src/mcp/capabilities.ts"],"sourcesContent":["import type { InvestigatorConfig } from '../config/schema.js'\nimport { resolveGraphMcpEndpoint } from './client.js'\n\nexport interface NetworkRetention {\n mode: 'full_history' | 'rolling_window' | 'expanding_then_rolling' | 'bounded_range' | 'unknown' | string\n window_days?: number\n from_block?: number\n to_block?: number\n from_timestamp?: string\n to_timestamp?: string\n started_at?: string\n rolls_after_at?: string\n current_window_seconds?: number\n}\n\nexport interface NetworkLayerCapability {\n enabled: boolean\n retention?: NetworkRetention | null\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 }\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}\n\nexport interface NetworkCapabilitiesDocument {\n schema: 'chain-insights.network-capabilities.v1'\n networks: NetworkCapability[]\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, 'mcpAuthToken' | 'graphMcpAuthToken' | 'graphMcpMode' | 'graphMcpEndpoint' | 'mcpEndpoint'>,\n): Promise<NetworkCapabilitiesDocument> {\n const endpoint = resolveGraphMcpEndpoint(config)\n const request = metadataNetworksUrl(endpoint)\n const headers = new Headers()\n const token = config.graphMcpAuthToken?.trim() || config.mcpAuthToken?.trim()\n if (token) {\n headers.set('X-MCP-Debug-Token', token)\n headers.set('Authorization', `Bearer ${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 (parsed.schema !== 'chain-insights.network-capabilities.v1' || !Array.isArray(parsed.networks)) {\n throw new Error('network capabilities response has unsupported schema')\n }\n return parsed\n}\n\nfunction layerValue(network: NetworkCapability, layer: string): string {\n const capability = network.layers[layer]\n if (!capability?.enabled) return 'no'\n return 'yes'\n}\n\nfunction availableToolsLabel(network: NetworkCapability): string {\n const tools = Object.entries(network.tools ?? {})\n .filter(([, status]) => status === 'available')\n .map(([name]) => name)\n return tools.length > 0 ? tools.join(', ') : 'none'\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 = coverage.from_block !== undefined && coverage.to_block !== undefined\n ? `${coverage.from_block}..${coverage.to_block}`\n : 'blocks unknown'\n const dateRange = coverage.from_timestamp && coverage.to_timestamp\n ? `${shortDate(coverage.from_timestamp)}..${shortDate(coverage.to_timestamp)}`\n : 'dates unknown'\n if (blockRange === 'blocks unknown' && dateRange === 'dates unknown') return 'unknown'\n return `${blockRange} / ${dateRange}`\n}\n\nexport function formatNetworkCapabilities(document: NetworkCapabilitiesDocument): string {\n if (document.networks.length === 0) return 'No supported networks advertised.'\n const headers = ['Network', 'Topology', 'Facts', 'Risk', 'Dataset', 'Available tools']\n const widths = [14, 10, 8, 8, 38, 64]\n const row = (values: string[]) => values.map((value, index) => value.padEnd(widths[index]!)).join(' ')\n return [\n row(headers),\n widths.map((width) => '-'.repeat(width)).join(' '),\n ...document.networks.map((network) => row([\n network.display_name || network.network,\n layerValue(network, 'topology'),\n layerValue(network, 'facts'),\n layerValue(network, 'risk'),\n datasetLabel(network),\n availableToolsLabel(network),\n ])),\n ].join('\\n')\n}\n"],"mappings":";;AAgDA,SAAS,oBAAoB,UAAuB;CAClD,MAAM,MAAM,IAAI,IAAI,QAAQ;CAC5B,IAAI,WAAW;CACf,IAAI,SAAS;CACb,IAAI,OAAO;CACX,OAAO;AACT;AAEA,eAAsB,yBACpB,QACsC;CAEtC,MAAM,UAAU,oBADC,wBAAwB,MACE,CAAC;CAC5C,MAAM,UAAU,IAAI,QAAQ;CAC5B,MAAM,QAAQ,OAAO,mBAAmB,KAAK,KAAK,OAAO,cAAc,KAAK;CAC5E,IAAI,OAAO;EACT,QAAQ,IAAI,qBAAqB,KAAK;EACtC,QAAQ,IAAI,iBAAiB,UAAU,OAAO;CAChD;CACA,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,MAAM,SAAS,EAAE,QAAQ,CAAC;CAC7C,SAAS,KAAK;EACZ,MAAM,IAAI,MAAM,uCAAuC,QAAQ,IAAK,IAAc,SAAS;CAC7F;CACA,IAAI,CAAC,SAAS,IACZ,MAAM,IAAI,MAAM,uCAAuC,QAAQ,SAAS,SAAS,QAAQ;CAE3F,MAAM,SAAS,MAAM,SAAS,KAAK;CACnC,IAAI,OAAO,WAAW,4CAA4C,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAC9F,MAAM,IAAI,MAAM,sDAAsD;CAExE,OAAO;AACT;AAEA,SAAS,WAAW,SAA4B,OAAuB;CAErE,IAAI,CADe,QAAQ,OAAO,QACjB,SAAS,OAAO;CACjC,OAAO;AACT;AAEA,SAAS,oBAAoB,SAAoC;CAC/D,MAAM,QAAQ,OAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAC7C,QAAQ,GAAG,YAAY,WAAW,WAAW,EAC7C,KAAK,CAAC,UAAU,IAAI;CACvB,OAAO,MAAM,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI;AAC/C;AAEA,SAAS,UAAU,OAAwB;CACzC,IAAI,CAAC,OAAO,OAAO;CACnB,OAAO,MAAM,MAAM,GAAG,EAAE;AAC1B;AAEA,SAAS,aAAa,SAAoC;CACxD,MAAM,WAAW,QAAQ;CACzB,IAAI,CAAC,UAAU,OAAO;CACtB,MAAM,aAAa,SAAS,eAAe,KAAA,KAAa,SAAS,aAAa,KAAA,IAC1E,GAAG,SAAS,WAAW,IAAI,SAAS,aACpC;CACJ,MAAM,YAAY,SAAS,kBAAkB,SAAS,eAClD,GAAG,UAAU,SAAS,cAAc,EAAE,IAAI,UAAU,SAAS,YAAY,MACzE;CACJ,IAAI,eAAe,oBAAoB,cAAc,iBAAiB,OAAO;CAC7E,OAAO,GAAG,WAAW,KAAK;AAC5B;AAEA,SAAgB,0BAA0B,UAA+C;CACvF,IAAI,SAAS,SAAS,WAAW,GAAG,OAAO;CAC3C,MAAM,UAAU;EAAC;EAAW;EAAY;EAAS;EAAQ;EAAW;CAAiB;CACrF,MAAM,SAAS;EAAC;EAAI;EAAI;EAAG;EAAG;EAAI;CAAE;CACpC,MAAM,OAAO,WAAqB,OAAO,KAAK,OAAO,UAAU,MAAM,OAAO,OAAO,MAAO,CAAC,EAAE,KAAK,IAAI;CACtG,OAAO;EACL,IAAI,OAAO;EACX,OAAO,KAAK,UAAU,IAAI,OAAO,KAAK,CAAC,EAAE,KAAK,IAAI;EAClD,GAAG,SAAS,SAAS,KAAK,YAAY,IAAI;GACxC,QAAQ,gBAAgB,QAAQ;GAChC,WAAW,SAAS,UAAU;GAC9B,WAAW,SAAS,OAAO;GAC3B,WAAW,SAAS,MAAM;GAC1B,aAAa,OAAO;GACpB,oBAAoB,OAAO;EAC7B,CAAC,CAAC;CACJ,EAAE,KAAK,IAAI;AACb"}
|
package/dist/cli.cjs
CHANGED
|
@@ -73,7 +73,7 @@ function optionalScamTopologyActivityPolicy(value) {
|
|
|
73
73
|
async function withGraphMcpClient(name, fn) {
|
|
74
74
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BwVx19Og.cjs")).then((n) => n.config_exports);
|
|
75
75
|
const config = await loadConfig();
|
|
76
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-
|
|
76
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-BYnFGA0y.cjs")).then((n) => n.client_exports);
|
|
77
77
|
const paymentFetch = await createConfiguredGraphMcpFetch(config);
|
|
78
78
|
const { Client } = await import("@modelcontextprotocol/sdk/client/index.js");
|
|
79
79
|
const { StreamableHTTPClientTransport } = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
@@ -93,7 +93,7 @@ function printMcpTextContent(result) {
|
|
|
93
93
|
}
|
|
94
94
|
async function printNetworkCapabilities(opts) {
|
|
95
95
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BwVx19Og.cjs")).then((n) => n.config_exports);
|
|
96
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-
|
|
96
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-B4hvro_I.cjs"));
|
|
97
97
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
98
98
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
99
99
|
else console.log(formatNetworkCapabilities(document));
|
|
@@ -215,7 +215,7 @@ program.command("access-key").description("Configure Graph MCP test access key m
|
|
|
215
215
|
}));
|
|
216
216
|
program.command("init").description("Initialize an investigation workspace").argument("[dir]", "Workspace directory to initialize", ".").option("--force", "Overwrite existing workspace files").action(async (dir, opts) => {
|
|
217
217
|
try {
|
|
218
|
-
const { initWorkspace } = await Promise.resolve().then(() => require("./init-
|
|
218
|
+
const { initWorkspace } = await Promise.resolve().then(() => require("./init-jhOZ_RvC.cjs"));
|
|
219
219
|
const result = await initWorkspace({
|
|
220
220
|
targetDir: dir,
|
|
221
221
|
force: opts.force
|
|
@@ -287,7 +287,7 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
287
287
|
}));
|
|
288
288
|
program.command("wallet").description("Manage the local Base USDC payment wallet").addCommand(new commander.Command("address").description("Print the local payment wallet address").action(async () => {
|
|
289
289
|
try {
|
|
290
|
-
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-
|
|
290
|
+
const { getWalletAccount } = await Promise.resolve().then(() => require("./tools-UH5hRXYG.cjs")).then((n) => n.tools_exports);
|
|
291
291
|
const account = await getWalletAccount();
|
|
292
292
|
console.log(account.address);
|
|
293
293
|
} catch (err) {
|
|
@@ -296,15 +296,31 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
296
296
|
}
|
|
297
297
|
})).addCommand(new commander.Command("balance").description("Show the local payment wallet Base USDC balance").action(async () => {
|
|
298
298
|
try {
|
|
299
|
-
const { getWalletBalanceText } = await Promise.resolve().then(() => require("./tools-
|
|
299
|
+
const { getWalletBalanceText } = await Promise.resolve().then(() => require("./tools-UH5hRXYG.cjs")).then((n) => n.tools_exports);
|
|
300
300
|
console.log(await getWalletBalanceText());
|
|
301
301
|
} catch (err) {
|
|
302
302
|
console.error(err.message);
|
|
303
303
|
process.exit(1);
|
|
304
304
|
}
|
|
305
|
+
})).addCommand(new commander.Command("ready").description("Check and prepare the wallet for paid GraphRAG MCP calls").option("--no-approve", "Only check readiness; do not submit the one-time payment approval").option("--approval-usdc <amount>", "USDC approval cap to prepare for paid calls", "1").option("--json", "Print machine-readable readiness metadata").action(async (opts) => {
|
|
306
|
+
try {
|
|
307
|
+
const { formatWalletReadiness, parsePaymentApprovalUnits, prepareWalletForPaidCalls } = await Promise.resolve().then(() => require("./tools-UH5hRXYG.cjs")).then((n) => n.tools_exports);
|
|
308
|
+
const result = await prepareWalletForPaidCalls({
|
|
309
|
+
minimumApprovalUnits: parsePaymentApprovalUnits(opts.approvalUsdc ?? "1"),
|
|
310
|
+
approve: opts.approve !== false
|
|
311
|
+
});
|
|
312
|
+
if (opts.json) {
|
|
313
|
+
console.log(JSON.stringify(result, (_key, value) => typeof value === "bigint" ? value.toString() : value, 2));
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
console.log(formatWalletReadiness(result.readiness, result.approval));
|
|
317
|
+
} catch (err) {
|
|
318
|
+
console.error(err.message);
|
|
319
|
+
process.exit(1);
|
|
320
|
+
}
|
|
305
321
|
})).addCommand(new commander.Command("topup").description("Open a local browser page to top up the payment wallet").option("--no-open", "Print the top-up URL without opening a browser").option("--json", "Print machine-readable top-up metadata").action(async (opts) => {
|
|
306
322
|
try {
|
|
307
|
-
const { buildTopupInfo, getWalletAccount } = await Promise.resolve().then(() => require("./tools-
|
|
323
|
+
const { buildTopupInfo, getWalletAccount } = await Promise.resolve().then(() => require("./tools-UH5hRXYG.cjs")).then((n) => n.tools_exports);
|
|
308
324
|
const { startTopupServer } = await Promise.resolve().then(() => require("./topup-server-yAaXYkJP.cjs")).then((n) => n.topup_server_exports);
|
|
309
325
|
const account = await getWalletAccount();
|
|
310
326
|
const url = await startTopupServer(account);
|
|
@@ -339,7 +355,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
339
355
|
const { formatToolsTable } = await Promise.resolve().then(() => require("./format-9NLBykEL.cjs"));
|
|
340
356
|
const { visibleRemoteTools } = await Promise.resolve().then(() => require("./tool-visibility-iAVQV3t0.cjs")).then((n) => n.tool_visibility_exports);
|
|
341
357
|
const { loadConfig } = await Promise.resolve().then(() => require("./config-BwVx19Og.cjs")).then((n) => n.config_exports);
|
|
342
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-
|
|
358
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-BYnFGA0y.cjs")).then((n) => n.client_exports);
|
|
343
359
|
const config = await loadConfig();
|
|
344
360
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
345
361
|
let tools = opts.refresh ? null : await loadSchema(graphMcpEndpoint);
|
|
@@ -378,7 +394,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
378
394
|
}));
|
|
379
395
|
return;
|
|
380
396
|
}
|
|
381
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
397
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
382
398
|
const result = await addressRisk(client, {
|
|
383
399
|
address: opts.address,
|
|
384
400
|
network: opts.network,
|
|
@@ -406,7 +422,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
406
422
|
}));
|
|
407
423
|
return;
|
|
408
424
|
}
|
|
409
|
-
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-
|
|
425
|
+
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
410
426
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
411
427
|
const result = await trackFunds(client, config, {
|
|
412
428
|
trustedAddresses: opts.trustedAddresses,
|
|
@@ -429,7 +445,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
429
445
|
const { requireWorkspaceRoot } = await Promise.resolve().then(() => require("./output-root-YIbl6PwF.cjs")).then((n) => n.output_root_exports);
|
|
430
446
|
requireWorkspaceRoot();
|
|
431
447
|
await withGraphMcpClient("chain-insights-cli-scam-topology", async (client, config) => {
|
|
432
|
-
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-
|
|
448
|
+
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
433
449
|
const incidentTimestampMs = optionalNumber(opts.incidentTimestampMs);
|
|
434
450
|
if (incidentTimestampMs === void 0) throw new Error("incident-timestamp-ms is required");
|
|
435
451
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
@@ -451,7 +467,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
451
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) => {
|
|
452
468
|
try {
|
|
453
469
|
await withGraphMcpClient("chain-insights-cli-stake-insights", async (client) => {
|
|
454
|
-
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-
|
|
470
|
+
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
455
471
|
const result = await stakeInsights(client, {
|
|
456
472
|
network: opts.network,
|
|
457
473
|
address: opts.address,
|
|
@@ -479,7 +495,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
479
495
|
assertPublicMcpToolName(tool);
|
|
480
496
|
await withGraphMcpClient("chain-insights-cli-call", async (client, config) => {
|
|
481
497
|
if (tool === "address_risk") {
|
|
482
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
498
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
483
499
|
const result = await addressRisk(client, {
|
|
484
500
|
address: String(args["address"] ?? ""),
|
|
485
501
|
network: String(args["network"] ?? ""),
|
|
@@ -489,7 +505,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
489
505
|
return;
|
|
490
506
|
}
|
|
491
507
|
if (tool === "track_funds") {
|
|
492
|
-
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-
|
|
508
|
+
const { trackFunds } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
493
509
|
const result = await trackFunds(client, config, {
|
|
494
510
|
trustedAddresses: args["trusted_addresses"] ?? "",
|
|
495
511
|
untrustedAddresses: args["untrusted_addresses"],
|
|
@@ -504,7 +520,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
504
520
|
return;
|
|
505
521
|
}
|
|
506
522
|
if (tool === "scam_topology") {
|
|
507
|
-
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-
|
|
523
|
+
const { scamTopology } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
508
524
|
const victimAddress = String(args["victim_address"] ?? "").trim();
|
|
509
525
|
if (!victimAddress) throw new Error("victim_address is required");
|
|
510
526
|
const incidentTimestampMs = optionalNumberArg(args["incident_timestamp_ms"], "incident_timestamp_ms");
|
|
@@ -522,7 +538,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
522
538
|
return;
|
|
523
539
|
}
|
|
524
540
|
if (tool === "stake_insights") {
|
|
525
|
-
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-
|
|
541
|
+
const { stakeInsights } = await Promise.resolve().then(() => require("./public-tools-BwguvIsf.cjs"));
|
|
526
542
|
const result = await stakeInsights(client, {
|
|
527
543
|
network: String(args["network"] ?? ""),
|
|
528
544
|
address: args["address"] === void 0 ? void 0 : String(args["address"]),
|
|
@@ -722,7 +738,7 @@ program.command("playbook").description("Run and manage investigation playbooks"
|
|
|
722
738
|
console.error(`Invalid --from value: "${opts.from}". Must be a positive integer.`);
|
|
723
739
|
process.exit(1);
|
|
724
740
|
}
|
|
725
|
-
const { PlaybookRunner } = await Promise.resolve().then(() => require("./runner-
|
|
741
|
+
const { PlaybookRunner } = await Promise.resolve().then(() => require("./runner-e9slg6R2.cjs"));
|
|
726
742
|
await PlaybookRunner.run(definition, {
|
|
727
743
|
caseId: opts.case,
|
|
728
744
|
from: fromN,
|
package/dist/cli.mjs
CHANGED
|
@@ -71,7 +71,7 @@ function optionalScamTopologyActivityPolicy(value) {
|
|
|
71
71
|
async function withGraphMcpClient(name, fn) {
|
|
72
72
|
const { loadConfig } = await import("./config-Drgc2HuF.mjs").then((n) => n.t);
|
|
73
73
|
const config = await loadConfig();
|
|
74
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-
|
|
74
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-Dl-uHrh1.mjs").then((n) => n.n);
|
|
75
75
|
const paymentFetch = await createConfiguredGraphMcpFetch(config);
|
|
76
76
|
const { Client } = await import("@modelcontextprotocol/sdk/client/index.js");
|
|
77
77
|
const { StreamableHTTPClientTransport } = await import("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
@@ -91,7 +91,7 @@ function printMcpTextContent(result) {
|
|
|
91
91
|
}
|
|
92
92
|
async function printNetworkCapabilities(opts) {
|
|
93
93
|
const { loadConfig } = await import("./config-Drgc2HuF.mjs").then((n) => n.t);
|
|
94
|
-
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-
|
|
94
|
+
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await import("./capabilities-mXm_rCe8.mjs");
|
|
95
95
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
96
96
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
97
97
|
else console.log(formatNetworkCapabilities(document));
|
|
@@ -213,7 +213,7 @@ program.command("access-key").description("Configure Graph MCP test access key m
|
|
|
213
213
|
}));
|
|
214
214
|
program.command("init").description("Initialize an investigation workspace").argument("[dir]", "Workspace directory to initialize", ".").option("--force", "Overwrite existing workspace files").action(async (dir, opts) => {
|
|
215
215
|
try {
|
|
216
|
-
const { initWorkspace } = await import("./init-
|
|
216
|
+
const { initWorkspace } = await import("./init-CB_ga4_8.mjs");
|
|
217
217
|
const result = await initWorkspace({
|
|
218
218
|
targetDir: dir,
|
|
219
219
|
force: opts.force
|
|
@@ -285,7 +285,7 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
285
285
|
}));
|
|
286
286
|
program.command("wallet").description("Manage the local Base USDC payment wallet").addCommand(new Command("address").description("Print the local payment wallet address").action(async () => {
|
|
287
287
|
try {
|
|
288
|
-
const { getWalletAccount } = await import("./tools-
|
|
288
|
+
const { getWalletAccount } = await import("./tools-D6RBAhSX.mjs").then((n) => n.c);
|
|
289
289
|
const account = await getWalletAccount();
|
|
290
290
|
console.log(account.address);
|
|
291
291
|
} catch (err) {
|
|
@@ -294,15 +294,31 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
294
294
|
}
|
|
295
295
|
})).addCommand(new Command("balance").description("Show the local payment wallet Base USDC balance").action(async () => {
|
|
296
296
|
try {
|
|
297
|
-
const { getWalletBalanceText } = await import("./tools-
|
|
297
|
+
const { getWalletBalanceText } = await import("./tools-D6RBAhSX.mjs").then((n) => n.c);
|
|
298
298
|
console.log(await getWalletBalanceText());
|
|
299
299
|
} catch (err) {
|
|
300
300
|
console.error(err.message);
|
|
301
301
|
process.exit(1);
|
|
302
302
|
}
|
|
303
|
+
})).addCommand(new Command("ready").description("Check and prepare the wallet for paid GraphRAG MCP calls").option("--no-approve", "Only check readiness; do not submit the one-time payment approval").option("--approval-usdc <amount>", "USDC approval cap to prepare for paid calls", "1").option("--json", "Print machine-readable readiness metadata").action(async (opts) => {
|
|
304
|
+
try {
|
|
305
|
+
const { formatWalletReadiness, parsePaymentApprovalUnits, prepareWalletForPaidCalls } = await import("./tools-D6RBAhSX.mjs").then((n) => n.c);
|
|
306
|
+
const result = await prepareWalletForPaidCalls({
|
|
307
|
+
minimumApprovalUnits: parsePaymentApprovalUnits(opts.approvalUsdc ?? "1"),
|
|
308
|
+
approve: opts.approve !== false
|
|
309
|
+
});
|
|
310
|
+
if (opts.json) {
|
|
311
|
+
console.log(JSON.stringify(result, (_key, value) => typeof value === "bigint" ? value.toString() : value, 2));
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
console.log(formatWalletReadiness(result.readiness, result.approval));
|
|
315
|
+
} catch (err) {
|
|
316
|
+
console.error(err.message);
|
|
317
|
+
process.exit(1);
|
|
318
|
+
}
|
|
303
319
|
})).addCommand(new Command("topup").description("Open a local browser page to top up the payment wallet").option("--no-open", "Print the top-up URL without opening a browser").option("--json", "Print machine-readable top-up metadata").action(async (opts) => {
|
|
304
320
|
try {
|
|
305
|
-
const { buildTopupInfo, getWalletAccount } = await import("./tools-
|
|
321
|
+
const { buildTopupInfo, getWalletAccount } = await import("./tools-D6RBAhSX.mjs").then((n) => n.c);
|
|
306
322
|
const { startTopupServer } = await import("./topup-server-BJgVw6Jt.mjs").then((n) => n.r);
|
|
307
323
|
const account = await getWalletAccount();
|
|
308
324
|
const url = await startTopupServer(account);
|
|
@@ -337,7 +353,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
337
353
|
const { formatToolsTable } = await import("./format-Bq94jSyw.mjs");
|
|
338
354
|
const { visibleRemoteTools } = await import("./tool-visibility-BHRFLXuU.mjs").then((n) => n.n);
|
|
339
355
|
const { loadConfig } = await import("./config-Drgc2HuF.mjs").then((n) => n.t);
|
|
340
|
-
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-
|
|
356
|
+
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await import("./client-Dl-uHrh1.mjs").then((n) => n.n);
|
|
341
357
|
const config = await loadConfig();
|
|
342
358
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
343
359
|
let tools = opts.refresh ? null : await loadSchema(graphMcpEndpoint);
|
|
@@ -376,7 +392,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
376
392
|
}));
|
|
377
393
|
return;
|
|
378
394
|
}
|
|
379
|
-
const { addressRisk } = await import("./public-tools-
|
|
395
|
+
const { addressRisk } = await import("./public-tools-DoRNhMn9.mjs");
|
|
380
396
|
const result = await addressRisk(client, {
|
|
381
397
|
address: opts.address,
|
|
382
398
|
network: opts.network,
|
|
@@ -404,7 +420,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
404
420
|
}));
|
|
405
421
|
return;
|
|
406
422
|
}
|
|
407
|
-
const { trackFunds } = await import("./public-tools-
|
|
423
|
+
const { trackFunds } = await import("./public-tools-DoRNhMn9.mjs");
|
|
408
424
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
409
425
|
const result = await trackFunds(client, config, {
|
|
410
426
|
trustedAddresses: opts.trustedAddresses,
|
|
@@ -427,7 +443,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
427
443
|
const { requireWorkspaceRoot } = await import("./output-root-BRhzhhXZ.mjs").then((n) => n.t);
|
|
428
444
|
requireWorkspaceRoot();
|
|
429
445
|
await withGraphMcpClient("chain-insights-cli-scam-topology", async (client, config) => {
|
|
430
|
-
const { scamTopology } = await import("./public-tools-
|
|
446
|
+
const { scamTopology } = await import("./public-tools-DoRNhMn9.mjs");
|
|
431
447
|
const incidentTimestampMs = optionalNumber(opts.incidentTimestampMs);
|
|
432
448
|
if (incidentTimestampMs === void 0) throw new Error("incident-timestamp-ms is required");
|
|
433
449
|
const caseId = opts.case ? await resolveCaseSelector(opts.case) : void 0;
|
|
@@ -449,7 +465,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
449
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) => {
|
|
450
466
|
try {
|
|
451
467
|
await withGraphMcpClient("chain-insights-cli-stake-insights", async (client) => {
|
|
452
|
-
const { stakeInsights } = await import("./public-tools-
|
|
468
|
+
const { stakeInsights } = await import("./public-tools-DoRNhMn9.mjs");
|
|
453
469
|
const result = await stakeInsights(client, {
|
|
454
470
|
network: opts.network,
|
|
455
471
|
address: opts.address,
|
|
@@ -477,7 +493,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
477
493
|
assertPublicMcpToolName(tool);
|
|
478
494
|
await withGraphMcpClient("chain-insights-cli-call", async (client, config) => {
|
|
479
495
|
if (tool === "address_risk") {
|
|
480
|
-
const { addressRisk } = await import("./public-tools-
|
|
496
|
+
const { addressRisk } = await import("./public-tools-DoRNhMn9.mjs");
|
|
481
497
|
const result = await addressRisk(client, {
|
|
482
498
|
address: String(args["address"] ?? ""),
|
|
483
499
|
network: String(args["network"] ?? ""),
|
|
@@ -487,7 +503,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
487
503
|
return;
|
|
488
504
|
}
|
|
489
505
|
if (tool === "track_funds") {
|
|
490
|
-
const { trackFunds } = await import("./public-tools-
|
|
506
|
+
const { trackFunds } = await import("./public-tools-DoRNhMn9.mjs");
|
|
491
507
|
const result = await trackFunds(client, config, {
|
|
492
508
|
trustedAddresses: args["trusted_addresses"] ?? "",
|
|
493
509
|
untrustedAddresses: args["untrusted_addresses"],
|
|
@@ -502,7 +518,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
502
518
|
return;
|
|
503
519
|
}
|
|
504
520
|
if (tool === "scam_topology") {
|
|
505
|
-
const { scamTopology } = await import("./public-tools-
|
|
521
|
+
const { scamTopology } = await import("./public-tools-DoRNhMn9.mjs");
|
|
506
522
|
const victimAddress = String(args["victim_address"] ?? "").trim();
|
|
507
523
|
if (!victimAddress) throw new Error("victim_address is required");
|
|
508
524
|
const incidentTimestampMs = optionalNumberArg(args["incident_timestamp_ms"], "incident_timestamp_ms");
|
|
@@ -520,7 +536,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
520
536
|
return;
|
|
521
537
|
}
|
|
522
538
|
if (tool === "stake_insights") {
|
|
523
|
-
const { stakeInsights } = await import("./public-tools-
|
|
539
|
+
const { stakeInsights } = await import("./public-tools-DoRNhMn9.mjs");
|
|
524
540
|
const result = await stakeInsights(client, {
|
|
525
541
|
network: String(args["network"] ?? ""),
|
|
526
542
|
address: args["address"] === void 0 ? void 0 : String(args["address"]),
|
|
@@ -720,7 +736,7 @@ program.command("playbook").description("Run and manage investigation playbooks"
|
|
|
720
736
|
console.error(`Invalid --from value: "${opts.from}". Must be a positive integer.`);
|
|
721
737
|
process.exit(1);
|
|
722
738
|
}
|
|
723
|
-
const { PlaybookRunner } = await import("./runner-
|
|
739
|
+
const { PlaybookRunner } = await import("./runner-BBH5Ks6q.mjs");
|
|
724
740
|
await PlaybookRunner.run(definition, {
|
|
725
741
|
caseId: opts.case,
|
|
726
742
|
from: fromN,
|