chain-insights 0.22.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -50
- package/dist/cli.cjs +21 -83
- package/dist/cli.mjs +21 -83
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-BVFf3v8-.cjs → config-B542AM4w.cjs} +2 -3
- package/dist/{config-CnNMdt4M.mjs → config-DbbPiGk0.mjs} +2 -3
- package/dist/{config-CnNMdt4M.mjs.map → config-DbbPiGk0.mjs.map} +1 -1
- package/dist/html-generator-BCDtYcGs.mjs +16 -0
- package/dist/{html-generator-D2BDzLED.mjs.map → html-generator-BCDtYcGs.mjs.map} +1 -1
- package/dist/html-generator-DFwMRWN3.cjs +16 -0
- package/dist/index.cjs +2 -8
- package/dist/index.d.cts +1 -99
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -99
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -6
- package/dist/mcp-proxy.cjs +35 -156
- package/dist/mcp-proxy.d.cts.map +1 -1
- package/dist/mcp-proxy.d.mts.map +1 -1
- package/dist/mcp-proxy.mjs +35 -156
- package/dist/mcp-proxy.mjs.map +1 -1
- package/dist/{public-tools-BFs_7U_Z.cjs → public-tools-Bou25cki.cjs} +153 -5
- package/dist/{public-tools-BjqZGGAC.mjs → public-tools-CpOLkME5.mjs} +152 -4
- package/dist/public-tools-CpOLkME5.mjs.map +1 -0
- package/dist/{schema-DOJA2nNi.mjs → schema-B0OuHW_l.mjs} +64 -5
- package/dist/schema-B0OuHW_l.mjs.map +1 -0
- package/dist/{schema-BpeV3xDV.cjs → schema-CtFWYoJz.cjs} +72 -7
- package/dist/{tool-visibility-DZBAP62b.cjs → tool-visibility-C8F9Yoxy.cjs} +1 -2
- package/dist/{tool-visibility-C0ALejXI.mjs → tool-visibility-CXbwfKhv.mjs} +2 -3
- package/dist/tool-visibility-CXbwfKhv.mjs.map +1 -0
- package/dist/{topup-server-rqI7bqem.mjs → topup-server-BLdF1SFQ.mjs} +2 -2
- package/dist/topup-server-BLdF1SFQ.mjs.map +1 -0
- package/dist/{topup-server-DAqmAuu1.cjs → topup-server-YN3iHrHW.cjs} +1 -1
- package/dist/{update-CJUfGCxs.mjs → update-MsoEFbhn.mjs} +2 -36
- package/dist/{update-CJUfGCxs.mjs.map → update-MsoEFbhn.mjs.map} +1 -1
- package/dist/{update-BJoXYucO.cjs → update-RKd0UW90.cjs} +0 -35
- package/docs/architecture.md +16 -46
- package/docs/contributing.md +0 -3
- package/docs/development.md +3 -5
- package/docs/graph-tools.md +4 -29
- package/docs/mcp-proxy.md +10 -36
- package/docs/stability.md +0 -12
- package/package.json +3 -4
- package/skills/chain-insights-address-risk/SKILL.md +0 -1
- package/dist/app-7NRCqx_Q.mjs +0 -140
- package/dist/app-7NRCqx_Q.mjs.map +0 -1
- package/dist/app-l9JE6bt3.cjs +0 -145
- package/dist/artifact-server-CH-asxF5.cjs +0 -47
- package/dist/artifact-server-DoxJr0z8.mjs +0 -49
- package/dist/artifact-server-DoxJr0z8.mjs.map +0 -1
- package/dist/graph-normalizer-B2Q2lgVy.cjs +0 -130
- package/dist/graph-normalizer-BA3Rbd6l.mjs +0 -127
- package/dist/graph-normalizer-BA3Rbd6l.mjs.map +0 -1
- package/dist/graph-reports-B6yoYbPq.mjs +0 -63
- package/dist/graph-reports-B6yoYbPq.mjs.map +0 -1
- package/dist/graph-reports-_gqzxvvs.cjs +0 -64
- package/dist/html-generator-B9f_GIi2.cjs +0 -86
- package/dist/html-generator-D2BDzLED.mjs +0 -70
- package/dist/init-Djhml4ih.mjs +0 -319
- package/dist/init-Djhml4ih.mjs.map +0 -1
- package/dist/init-DvrKxK15.cjs +0 -319
- package/dist/limits-D3Mn-gig.mjs +0 -94
- package/dist/limits-D3Mn-gig.mjs.map +0 -1
- package/dist/limits-km3pmmL3.cjs +0 -115
- package/dist/mcp-endpoint-BIWrUOFG.cjs +0 -56
- package/dist/mcp-endpoint-DbWtLcba.mjs +0 -41
- package/dist/mcp-endpoint-DbWtLcba.mjs.map +0 -1
- package/dist/output-root-BK4pdjyz.mjs +0 -36
- package/dist/output-root-BK4pdjyz.mjs.map +0 -1
- package/dist/output-root-BewoQaTx.cjs +0 -46
- package/dist/public-tools-BjqZGGAC.mjs.map +0 -1
- package/dist/resolve-port-CbaEoODz.cjs +0 -18
- package/dist/resolve-port-DxPK7Ipx.mjs +0 -20
- package/dist/resolve-port-DxPK7Ipx.mjs.map +0 -1
- package/dist/schema-DOJA2nNi.mjs.map +0 -1
- package/dist/server-CmvzYu7v.cjs +0 -55
- package/dist/server-mDSRgk1X.mjs +0 -46
- package/dist/server-mDSRgk1X.mjs.map +0 -1
- package/dist/templates/graph.html +0 -1450
- package/dist/tool-visibility-C0ALejXI.mjs.map +0 -1
- package/dist/topup-server-rqI7bqem.mjs.map +0 -1
- package/dist/viz-BJ_kyRjI.cjs +0 -217
- package/dist/viz-Uh_EF-qB.mjs +0 -206
- package/dist/viz-Uh_EF-qB.mjs.map +0 -1
- package/docs/images/graph-mcp-iframe.png +0 -0
- package/docs/images/graph-visualization.png +0 -0
- package/docs/images/quickstart-demo.svg +0 -1
- package/docs/investigation-workspaces.md +0 -108
- package/docs/search-limits.md +0 -73
package/README.md
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
Chain Insights is open-source AML and forensics infrastructure for AI agents
|
|
11
11
|
and analysts: a hosted Chain Insights Graph you reach over MCP, screened
|
|
12
12
|
through one CLI. It screens blockchain addresses for risk, explores fund flows
|
|
13
|
-
through read-only graph queries, and
|
|
14
|
-
|
|
13
|
+
through read-only graph queries, and returns structured investigation facts.
|
|
14
|
+
Every new account gets a free tier — a daily allowance
|
|
15
15
|
of graph queries, no payment setup — so you can run a first screen in minutes.
|
|
16
16
|
|
|
17
17
|
## Quickstart
|
|
@@ -22,14 +22,11 @@ as-is on macOS; on Windows use WSL.
|
|
|
22
22
|
```bash
|
|
23
23
|
npx chain-insights@latest --help # run without installing
|
|
24
24
|
npm install -g chain-insights # or install the cia CLI globally
|
|
25
|
-
cia init ~/cases # optional local investigation folder
|
|
26
25
|
cia mcp call aml_address_risk network=robinhood address=0xYourAddressHere
|
|
27
26
|
cia networks # supported networks + public tool surface
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Sixty seconds gets you the CLI, a workspace, and the live tool catalog.
|
|
29
|
+
Sixty seconds gets you the CLI and the live tool catalog.
|
|
33
30
|
To call the same tools from an agent, register the MCP proxy:
|
|
34
31
|
`cia setup claude-code` (or `codex` / `hermes`).
|
|
35
32
|
|
|
@@ -49,7 +46,6 @@ Owns:
|
|
|
49
46
|
- The canonical public tool surface: prefixed `aml_*` / `graph_*` / `meta_*`
|
|
50
47
|
/ `wallet_*` tools.
|
|
51
48
|
- Local wallet and payment on Base mainnet (payment chain only).
|
|
52
|
-
- Investigation workspaces, graph reports, and visualization.
|
|
53
49
|
- Shipped product skills under `skills/` (`chain-insights-*`), packaged
|
|
54
50
|
into the npm tarball.
|
|
55
51
|
|
|
@@ -60,8 +56,8 @@ Never touches:
|
|
|
60
56
|
- Automatic risk labeling. Address labels are served by the Chain Insights
|
|
61
57
|
Graph backend and read through `aml_address_risk`; the CLI never writes
|
|
62
58
|
labels.
|
|
63
|
-
- Custodial wallets or hosted case databases. Investigation data stays
|
|
64
|
-
the
|
|
59
|
+
- Custodial wallets or hosted case databases. Investigation data stays with
|
|
60
|
+
the caller.
|
|
65
61
|
|
|
66
62
|
### What You Can Do Today
|
|
67
63
|
|
|
@@ -80,8 +76,8 @@ Never touches:
|
|
|
80
76
|
Upstream:
|
|
81
77
|
|
|
82
78
|
- **Chain Insights Graph MCP endpoint** — all graph queries and AML
|
|
83
|
-
primitives. Configured via `graphMcpEndpoint`; defaults to
|
|
84
|
-
endpoint.
|
|
79
|
+
primitives. Configured via `graphMcpEndpoint`; defaults to the public
|
|
80
|
+
production endpoint `https://mcp.chain-insights.ai/`.
|
|
85
81
|
- **Base mainnet RPC** — wallet balance and payment only
|
|
86
82
|
(`BASE_RPC_URL` override). Not a graph-support claim.
|
|
87
83
|
|
|
@@ -93,13 +89,13 @@ Downstream:
|
|
|
93
89
|
## Architecture
|
|
94
90
|
|
|
95
91
|
Chain Insights is the investigation layer above the Chain Insights Graph.
|
|
96
|
-
The CLI and MCP proxy call graph tools over one MCP endpoint
|
|
97
|
-
|
|
92
|
+
The CLI and MCP proxy call graph tools over one MCP endpoint and never write
|
|
93
|
+
to the graph.
|
|
98
94
|
|
|
99
95
|
```text
|
|
100
96
|
Agent or CLI user
|
|
101
97
|
-> Chain Insights CLI / MCP proxy
|
|
102
|
-
-> local config
|
|
98
|
+
-> local config and wallet
|
|
103
99
|
-> Chain Insights Graph
|
|
104
100
|
-> graph intelligence for AML workflows
|
|
105
101
|
```
|
|
@@ -112,8 +108,6 @@ Source modules (hand-maintained):
|
|
|
112
108
|
| `federation` | `src/federation` | [components/federation.md](docs/architecture/components/federation.md) |
|
|
113
109
|
| `investigation` | `src/investigation` | [components/investigation.md](docs/architecture/components/investigation.md) |
|
|
114
110
|
| `mcp` | `src/mcp` | [components/mcp.md](docs/architecture/components/mcp.md) |
|
|
115
|
-
| `server` | `src/server` | [components/server.md](docs/architecture/components/server.md) |
|
|
116
|
-
| `viz` | `src/viz` | [components/viz.md](docs/architecture/components/viz.md) |
|
|
117
111
|
| `wallet` | `src/wallet` | [components/wallet.md](docs/architecture/components/wallet.md) |
|
|
118
112
|
|
|
119
113
|
Entry points:
|
|
@@ -213,24 +207,13 @@ cia --version
|
|
|
213
207
|
cia update --check
|
|
214
208
|
```
|
|
215
209
|
|
|
216
|
-
|
|
210
|
+
Run a first screen from any directory:
|
|
217
211
|
|
|
218
212
|
```bash
|
|
219
|
-
mkdir -p ./chain-insights-investigations
|
|
220
|
-
cd ./chain-insights-investigations
|
|
221
|
-
cia init .
|
|
222
|
-
|
|
223
213
|
cia mcp call aml_address_risk \
|
|
224
214
|
network=robinhood address=0xYourAddressHere
|
|
225
|
-
|
|
226
|
-
find reports -maxdepth 3 -type f | sort
|
|
227
215
|
```
|
|
228
216
|
|
|
229
|
-
Workspaces are plain local folders. Reports, graph JSON, graph HTML, and
|
|
230
|
-
published bundles live under the initialized workspace. Export only when
|
|
231
|
-
you need to share, hand off, or archive a review checkpoint — the handoff
|
|
232
|
-
package lands under `published/<workspace-slug>/`.
|
|
233
|
-
|
|
234
217
|
Example queries. Direct topology:
|
|
235
218
|
|
|
236
219
|
```bash
|
|
@@ -253,16 +236,17 @@ More query examples (manual fund-flow reads, pagination):
|
|
|
253
236
|
## Configure
|
|
254
237
|
|
|
255
238
|
`cia` uses `graphMcpEndpoint` for all Chain Insights Graph calls. The npm
|
|
256
|
-
package
|
|
239
|
+
package uses the public production endpoint by default, so a fresh install can
|
|
240
|
+
run `cia networks` immediately.
|
|
257
241
|
|
|
258
|
-
|
|
242
|
+
For local development, override the default explicitly:
|
|
259
243
|
|
|
260
244
|
```bash
|
|
261
245
|
cia config set graphMcpEndpoint http://127.0.0.1:8012/mcp
|
|
262
246
|
```
|
|
263
247
|
|
|
264
|
-
|
|
265
|
-
|
|
248
|
+
The public production Graph is already the default. Use the host root. Do not
|
|
249
|
+
add `/mcp`.
|
|
266
250
|
|
|
267
251
|
```bash
|
|
268
252
|
cia config set graphMcpEndpoint https://mcp.chain-insights.ai/
|
|
@@ -279,7 +263,7 @@ Configuration precedence:
|
|
|
279
263
|
1. `CHAIN_INSIGHTS_GRAPH_MCP_ENDPOINT` env var (`GRAPH_MCP_ENDPOINT`
|
|
280
264
|
legacy alias also supported).
|
|
281
265
|
2. `cia config set graphMcpEndpoint ...` saved value.
|
|
282
|
-
3.
|
|
266
|
+
3. Public production default `https://mcp.chain-insights.ai/`.
|
|
283
267
|
|
|
284
268
|
Validation rules:
|
|
285
269
|
|
|
@@ -298,9 +282,6 @@ The hosted graph includes a small public free tier for `graph_query`
|
|
|
298
282
|
users receive the free tier first, then paid access continues
|
|
299
283
|
automatically.
|
|
300
284
|
|
|
301
|
-
Search bounds (hops, row limits, frontiers) are tunable per call, per
|
|
302
|
-
network, or globally — see [Search limits](docs/search-limits.md).
|
|
303
|
-
|
|
304
285
|
## Test
|
|
305
286
|
|
|
306
287
|
Local gate, in order:
|
|
@@ -348,25 +329,23 @@ cia --version && cia update --check
|
|
|
348
329
|
```
|
|
349
330
|
|
|
350
331
|
If network or tool discovery fails, check the endpoint and access mode
|
|
351
|
-
first.
|
|
352
|
-
|
|
332
|
+
first. Confirm the endpoint with `cia config get graphMcpEndpoint` and retry
|
|
333
|
+
the command.
|
|
353
334
|
|
|
354
335
|
## Documentation Links
|
|
355
336
|
|
|
356
337
|
Product docs:
|
|
357
338
|
|
|
358
|
-
| Doc | Use it for
|
|
359
|
-
| -------------------------------------------------------------- |
|
|
360
|
-
| [Graph tools](docs/graph-tools.md) | Graph layers, `graph_query`, `graph_query_batch`, AML tool contracts
|
|
361
|
-
| [Graph query compatibility](docs/graph-query-compatibility.md) | GQL/Cypher support per layer, rewrite recipes, traversal guidance
|
|
362
|
-
| [
|
|
363
|
-
| [
|
|
364
|
-
| [
|
|
365
|
-
| [
|
|
366
|
-
| [
|
|
367
|
-
| [
|
|
368
|
-
| [Stability policy](docs/stability.md) | Guaranteed surfaces (exit codes, MCP tool names, workspace layout), deprecation rules |
|
|
369
|
-
| [Debugging](docs/debugging.md) | Local troubleshooting, diagnostics, debug workflows |
|
|
339
|
+
| Doc | Use it for |
|
|
340
|
+
| -------------------------------------------------------------- | -------------------------------------------------------------------------- |
|
|
341
|
+
| [Graph tools](docs/graph-tools.md) | Graph layers, `graph_query`, `graph_query_batch`, and AML tool contracts |
|
|
342
|
+
| [Graph query compatibility](docs/graph-query-compatibility.md) | GQL/Cypher support per layer, rewrite recipes, traversal guidance |
|
|
343
|
+
| [MCP proxy](docs/mcp-proxy.md) | Stdio proxy behavior, endpoint configuration, agent installers, auth modes |
|
|
344
|
+
| [Architecture overview](docs/architecture.md) | Product layers, data flow, security model, and config keys |
|
|
345
|
+
| [Development](docs/development.md) | Build, test, and local install commands |
|
|
346
|
+
| [Contributing](docs/contributing.md) | Development workflow, pull requests, release expectations |
|
|
347
|
+
| [Stability policy](docs/stability.md) | Guaranteed surfaces, deprecation rules, and compatibility expectations |
|
|
348
|
+
| [Debugging](docs/debugging.md) | Local troubleshooting, diagnostics, debug workflows |
|
|
370
349
|
|
|
371
350
|
Architecture depth:
|
|
372
351
|
|
package/dist/cli.cjs
CHANGED
|
@@ -50,7 +50,7 @@ function runInstaller(flag) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
async function withGraphMcpClient(name, fn) {
|
|
53
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
53
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
54
54
|
const config = await loadConfig();
|
|
55
55
|
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-CqAzD519.cjs")).then((n) => n.client_exports);
|
|
56
56
|
const paymentFetch = await createConfiguredGraphMcpFetch(config);
|
|
@@ -70,7 +70,7 @@ async function withGraphMcpClient(name, fn) {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
async function printNetworkCapabilities(opts) {
|
|
73
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
73
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
74
74
|
const { fetchNetworkCapabilities, formatNetworkCapabilities } = await Promise.resolve().then(() => require("./capabilities-CPcrxodx.cjs")).then((n) => n.capabilities_exports);
|
|
75
75
|
const document = await fetchNetworkCapabilities(await loadConfig());
|
|
76
76
|
if (opts.json) console.log(JSON.stringify(document, null, 2));
|
|
@@ -84,37 +84,17 @@ program.command("networks").alias("network").description("List supported graph n
|
|
|
84
84
|
process.exit(1);
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
program.command("serve").description("Start local visualization server").option("-p, --port <number>", "Port to bind (defaults to the configured serverPort)").action(async (opts) => {
|
|
88
|
-
try {
|
|
89
|
-
const { requireWorkspaceRoot } = await Promise.resolve().then(() => require("./output-root-BewoQaTx.cjs")).then((n) => n.output_root_exports);
|
|
90
|
-
const workspaceRoot = requireWorkspaceRoot();
|
|
91
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-BVFf3v8-.cjs")).then((n) => n.config_exports);
|
|
92
|
-
const { resolveServerPort } = await Promise.resolve().then(() => require("./resolve-port-CbaEoODz.cjs"));
|
|
93
|
-
const config = await loadConfig();
|
|
94
|
-
const port = resolveServerPort(opts.port, config.serverPort);
|
|
95
|
-
const { startServer } = await Promise.resolve().then(() => require("./server-CmvzYu7v.cjs")).then((n) => n.server_exports);
|
|
96
|
-
console.log(`Workspace: ${workspaceRoot}`);
|
|
97
|
-
startServer(port);
|
|
98
|
-
} catch (err) {
|
|
99
|
-
console.error(err.message);
|
|
100
|
-
process.exit(1);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
87
|
program.command("status").description("Show toolkit status and configuration").action(async () => {
|
|
104
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
105
|
-
const { findActiveWorkspace, activeDataDir } = await Promise.resolve().then(() => require("./active-Bc13hJIm.cjs")).then((n) => n.active_exports);
|
|
88
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
106
89
|
const config = await loadConfig();
|
|
107
|
-
const workspace = findActiveWorkspace();
|
|
108
90
|
const graphMcpStatus = config.graphMcpMode === "debug" && config.graphMcpAuthToken?.trim() ? "bearer access mode" : `${config.graphMcpMode} mode`;
|
|
109
|
-
console.log("Config: ",
|
|
110
|
-
if (workspace) console.log("Workspace:", workspace.root);
|
|
111
|
-
console.log("Server: ", `http://127.0.0.1:${config.serverPort}`);
|
|
91
|
+
console.log("Config: ", config.dataDir);
|
|
112
92
|
console.log("Chain Insights Graph:", graphMcpStatus);
|
|
113
93
|
console.log("Graph endpoint:", config.graphMcpEndpoint);
|
|
114
94
|
});
|
|
115
95
|
program.command("update").description("Check npmjs for a newer Chain Insights release and update this CLI").option("--check", "Only check for a newer release").option("--dry-run", "Print the update command without running it").action(async (opts) => {
|
|
116
96
|
try {
|
|
117
|
-
const { checkForUpdate, runPackageUpdate } = await Promise.resolve().then(() => require("./update-
|
|
97
|
+
const { checkForUpdate, runPackageUpdate } = await Promise.resolve().then(() => require("./update-RKd0UW90.cjs"));
|
|
118
98
|
const result = await checkForUpdate();
|
|
119
99
|
if (result.error) throw new Error(`Could not check npmjs for updates: ${result.error}`);
|
|
120
100
|
if (!result.updateAvailable || !result.latestVersion) {
|
|
@@ -139,7 +119,7 @@ program.command("update").description("Check npmjs for a newer Chain Insights re
|
|
|
139
119
|
});
|
|
140
120
|
program.command("debug").description("Configure Chain Insights Graph debug mode").addCommand(new commander.Command("on").description("Enable Chain Insights Graph debug mode without x402 payments").requiredOption("--token <token>", "Debug bearer token").option("--endpoint <url>", "Chain Insights Graph endpoint").action(async (opts) => {
|
|
141
121
|
try {
|
|
142
|
-
const { saveConfig } = await Promise.resolve().then(() => require("./config-
|
|
122
|
+
const { saveConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
143
123
|
await saveConfig({
|
|
144
124
|
graphMcpMode: "debug",
|
|
145
125
|
graphMcpAuthToken: opts.token,
|
|
@@ -154,7 +134,7 @@ program.command("debug").description("Configure Chain Insights Graph debug mode"
|
|
|
154
134
|
}
|
|
155
135
|
})).addCommand(new commander.Command("off").description("Disable Chain Insights Graph debug mode and use paid x402 calls").action(async () => {
|
|
156
136
|
try {
|
|
157
|
-
const { saveConfig } = await Promise.resolve().then(() => require("./config-
|
|
137
|
+
const { saveConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
158
138
|
await saveConfig({
|
|
159
139
|
graphMcpMode: "paid",
|
|
160
140
|
graphMcpAuthToken: ""
|
|
@@ -167,7 +147,7 @@ program.command("debug").description("Configure Chain Insights Graph debug mode"
|
|
|
167
147
|
}
|
|
168
148
|
})).addCommand(new commander.Command("status").description("Show Chain Insights Graph payment/debug mode").action(async () => {
|
|
169
149
|
try {
|
|
170
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
150
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
171
151
|
const config = await loadConfig();
|
|
172
152
|
console.log(`Chain Insights Graph mode: ${config.graphMcpMode}`);
|
|
173
153
|
console.log(`Graph endpoint: ${config.graphMcpEndpoint}`);
|
|
@@ -182,7 +162,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
182
162
|
try {
|
|
183
163
|
const normalizedKey = key.trim();
|
|
184
164
|
if (!normalizedKey) throw new Error("Test access key is required");
|
|
185
|
-
const { saveConfig } = await Promise.resolve().then(() => require("./config-
|
|
165
|
+
const { saveConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
186
166
|
await saveConfig({
|
|
187
167
|
graphMcpMode: "debug",
|
|
188
168
|
graphMcpAuthToken: normalizedKey,
|
|
@@ -197,7 +177,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
197
177
|
}
|
|
198
178
|
})).addCommand(new commander.Command("clear").description("Remove the Chain Insights Graph test access key and use paid x402 calls").action(async () => {
|
|
199
179
|
try {
|
|
200
|
-
const { saveConfig } = await Promise.resolve().then(() => require("./config-
|
|
180
|
+
const { saveConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
201
181
|
await saveConfig({
|
|
202
182
|
graphMcpMode: "paid",
|
|
203
183
|
graphMcpAuthToken: ""
|
|
@@ -210,7 +190,7 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
210
190
|
}
|
|
211
191
|
})).addCommand(new commander.Command("status").description("Show Chain Insights Graph test access key status").action(async () => {
|
|
212
192
|
try {
|
|
213
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
193
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
214
194
|
const config = await loadConfig();
|
|
215
195
|
console.log(`Graph endpoint: ${config.graphMcpEndpoint}`);
|
|
216
196
|
console.log(`Access key: ${config.graphMcpAuthToken?.trim() ? "configured" : "not configured"}`);
|
|
@@ -220,22 +200,6 @@ program.command("access-key").description("Configure Chain Insights Graph test a
|
|
|
220
200
|
process.exit(1);
|
|
221
201
|
}
|
|
222
202
|
}));
|
|
223
|
-
program.command("init").description("Initialize an investigation workspace").argument("[dir]", "Workspace directory to initialize", ".").option("--force", "Overwrite existing workspace files").action(async (dir, opts) => {
|
|
224
|
-
try {
|
|
225
|
-
const { initWorkspace } = await Promise.resolve().then(() => require("./init-DvrKxK15.cjs"));
|
|
226
|
-
const result = await initWorkspace({
|
|
227
|
-
targetDir: dir,
|
|
228
|
-
force: opts.force
|
|
229
|
-
});
|
|
230
|
-
console.log(`Workspace initialized: ${result.workspaceRoot}`);
|
|
231
|
-
console.log(`Files written: ${result.filesWritten.length}`);
|
|
232
|
-
const { maybePromptForUpdate } = await Promise.resolve().then(() => require("./update-BJoXYucO.cjs"));
|
|
233
|
-
await maybePromptForUpdate();
|
|
234
|
-
} catch (err) {
|
|
235
|
-
console.error(err.message);
|
|
236
|
-
process.exit(1);
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
203
|
program.command("setup").description("Configure external MCP clients").addCommand(new commander.Command("claude-code").alias("claude").description("Install Claude Code skills and register the MCP proxy").action(() => {
|
|
240
204
|
runInstaller("--claude");
|
|
241
205
|
})).addCommand(new commander.Command("codex").description("Install Codex skills and register the MCP proxy").action(() => {
|
|
@@ -244,8 +208,8 @@ program.command("setup").description("Configure external MCP clients").addComman
|
|
|
244
208
|
runInstaller("--hermes");
|
|
245
209
|
}));
|
|
246
210
|
program.command("config").description("Read or write configuration values").addCommand(new commander.Command("get").argument("<key>", "Config key to read").action(async (key) => {
|
|
247
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
248
|
-
const { CONFIG_KEYS } = await Promise.resolve().then(() => require("./schema-
|
|
211
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
212
|
+
const { CONFIG_KEYS } = await Promise.resolve().then(() => require("./schema-CtFWYoJz.cjs")).then((n) => n.schema_exports);
|
|
249
213
|
if (!CONFIG_KEYS.includes(key)) {
|
|
250
214
|
console.error(`Unknown config key: ${key}`);
|
|
251
215
|
process.exit(1);
|
|
@@ -265,8 +229,8 @@ program.command("config").description("Read or write configuration values").addC
|
|
|
265
229
|
}
|
|
266
230
|
return;
|
|
267
231
|
}
|
|
268
|
-
const { loadConfig, saveConfig } = await Promise.resolve().then(() => require("./config-
|
|
269
|
-
const { CONFIG_KEYS, DEFAULT_CONFIG } = await Promise.resolve().then(() => require("./schema-
|
|
232
|
+
const { loadConfig, saveConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
233
|
+
const { CONFIG_KEYS, DEFAULT_CONFIG } = await Promise.resolve().then(() => require("./schema-CtFWYoJz.cjs")).then((n) => n.schema_exports);
|
|
270
234
|
const current = await loadConfig();
|
|
271
235
|
if (!CONFIG_KEYS.includes(key)) {
|
|
272
236
|
console.error(`Unknown config key: ${key}`);
|
|
@@ -327,7 +291,7 @@ program.command("wallet").description("Manage the local Base USDC payment wallet
|
|
|
327
291
|
})).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) => {
|
|
328
292
|
try {
|
|
329
293
|
const { buildTopupInfo, getWalletAccount } = await Promise.resolve().then(() => require("./tools-lPY6k-vJ.cjs")).then((n) => n.tools_exports);
|
|
330
|
-
const { startTopupServer } = await Promise.resolve().then(() => require("./topup-server-
|
|
294
|
+
const { startTopupServer } = await Promise.resolve().then(() => require("./topup-server-YN3iHrHW.cjs")).then((n) => n.topup_server_exports);
|
|
331
295
|
const account = await getWalletAccount();
|
|
332
296
|
const url = await startTopupServer(account);
|
|
333
297
|
const info = buildTopupInfo(account.address, url);
|
|
@@ -359,8 +323,8 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
359
323
|
try {
|
|
360
324
|
const { loadSchema, saveSchema } = await Promise.resolve().then(() => require("./schema-cache-n7Gbhvsj.cjs"));
|
|
361
325
|
const { formatToolsTable } = await Promise.resolve().then(() => require("./format-9NLBykEL.cjs"));
|
|
362
|
-
const { visibleRemoteTools } = await Promise.resolve().then(() => require("./tool-visibility-
|
|
363
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-
|
|
326
|
+
const { visibleRemoteTools } = await Promise.resolve().then(() => require("./tool-visibility-C8F9Yoxy.cjs")).then((n) => n.tool_visibility_exports);
|
|
327
|
+
const { loadConfig } = await Promise.resolve().then(() => require("./config-B542AM4w.cjs")).then((n) => n.config_exports);
|
|
364
328
|
const { createConfiguredGraphMcpFetch, resolveGraphMcpEndpoint } = await Promise.resolve().then(() => require("./client-CqAzD519.cjs")).then((n) => n.client_exports);
|
|
365
329
|
const config = await loadConfig();
|
|
366
330
|
const graphMcpEndpoint = resolveGraphMcpEndpoint(config);
|
|
@@ -389,7 +353,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
389
353
|
})).addCommand(new commander.Command("aml-address-risk").description("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 `cia mcp networks` for supported networks.").option("--compare-address <address>", "Optional second address to compare against the screened address").action(async (opts) => {
|
|
390
354
|
try {
|
|
391
355
|
await withGraphMcpClient("chain-insights-cli-aml-address-risk", async (client) => {
|
|
392
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
356
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-Bou25cki.cjs"));
|
|
393
357
|
const result = await addressRisk(client, {
|
|
394
358
|
address: opts.address,
|
|
395
359
|
network: opts.network,
|
|
@@ -404,7 +368,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
404
368
|
})).addCommand(new commander.Command("call").description("Call an MCP tool directly (debug)").argument("<tool>", "Tool name to call").argument("[args...]", "Key=value arguments (e.g. address=0x1234... network=robinhood)").action(async (tool, rawArgs) => {
|
|
405
369
|
try {
|
|
406
370
|
const { parseMcpCallArgs } = await Promise.resolve().then(() => require("./call-args-DAiQSDmD.cjs"));
|
|
407
|
-
const { assertPublicMcpToolName, validatePublicMcpToolArguments } = await Promise.resolve().then(() => require("./tool-visibility-
|
|
371
|
+
const { assertPublicMcpToolName, validatePublicMcpToolArguments } = await Promise.resolve().then(() => require("./tool-visibility-C8F9Yoxy.cjs")).then((n) => n.tool_visibility_exports);
|
|
408
372
|
const args = parseMcpCallArgs(rawArgs);
|
|
409
373
|
assertPublicMcpToolName(tool);
|
|
410
374
|
validatePublicMcpToolArguments(tool, args);
|
|
@@ -437,7 +401,7 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
437
401
|
return;
|
|
438
402
|
}
|
|
439
403
|
if (tool === "aml_address_risk") {
|
|
440
|
-
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-
|
|
404
|
+
const { addressRisk } = await Promise.resolve().then(() => require("./public-tools-Bou25cki.cjs"));
|
|
441
405
|
const result = await addressRisk(client, {
|
|
442
406
|
address: String(args["address"] ?? ""),
|
|
443
407
|
network: String(args["network"] ?? ""),
|
|
@@ -456,32 +420,6 @@ program.command("mcp").description("Interact with the Chain Insights MCP endpoin
|
|
|
456
420
|
process.exit(1);
|
|
457
421
|
}
|
|
458
422
|
}));
|
|
459
|
-
program.command("viz").description("Generate a workspace visualization").argument("[source-id]", "Workspace graph report ID to render").option("--data <file>", "Raw transaction JSON file for ad-hoc visualization").option("-p, --port <number>", "Server port (defaults to the configured serverPort)").action(async (sourceId, opts) => {
|
|
460
|
-
try {
|
|
461
|
-
if (!sourceId && !opts.data) {
|
|
462
|
-
console.error("Provide either a visualization source ID or --data <file.json>");
|
|
463
|
-
process.exit(1);
|
|
464
|
-
}
|
|
465
|
-
const { loadConfig } = await Promise.resolve().then(() => require("./config-BVFf3v8-.cjs")).then((n) => n.config_exports);
|
|
466
|
-
const { resolveServerPort } = await Promise.resolve().then(() => require("./resolve-port-CbaEoODz.cjs"));
|
|
467
|
-
const config = await loadConfig();
|
|
468
|
-
const port = resolveServerPort(opts.port, config.serverPort);
|
|
469
|
-
const { generateVisualization } = await Promise.resolve().then(() => require("./viz-BJ_kyRjI.cjs")).then((n) => n.viz_exports);
|
|
470
|
-
const result = await generateVisualization({
|
|
471
|
-
sourceId,
|
|
472
|
-
dataFile: opts.data
|
|
473
|
-
});
|
|
474
|
-
const { startServer } = await Promise.resolve().then(() => require("./server-CmvzYu7v.cjs")).then((n) => n.server_exports);
|
|
475
|
-
startServer(port);
|
|
476
|
-
const url = `http://127.0.0.1:${port}/viz/${result.vizId}`;
|
|
477
|
-
console.log(`Visualization: ${url}`);
|
|
478
|
-
const open = (await import("open")).default;
|
|
479
|
-
await open(url);
|
|
480
|
-
} catch (err) {
|
|
481
|
-
console.error(err.message);
|
|
482
|
-
process.exit(1);
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
423
|
program.parseAsync(process.argv).catch((err) => {
|
|
486
424
|
console.error(err.message);
|
|
487
425
|
process.exit(1);
|