chain-insights 0.43.0 → 0.44.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 CHANGED
@@ -28,16 +28,13 @@ as-is on macOS; on Windows use WSL.
28
28
  ```bash
29
29
  npx chain-insights@latest --help # run without installing
30
30
  npm install -g chain-insights # or install the cia CLI globally
31
- cia workflows # list high-level CIA workflow tools
32
- cia workflow aml-address-risk \
33
- --address 0xYourAddressHere --network robinhood
34
31
  cia networks # network status + dataset overview
35
32
  cia network robinhood # details for one network
36
33
  cia mcp tools # list remote graph tools
37
34
  ```
38
35
 
39
- Sixty seconds gets you the CLI, a network overview, a CIA workflow, and the
40
- available remote graph tools for Robinhood.
36
+ Sixty seconds gets you the CLI, a network overview, and the available remote
37
+ graph tools for Robinhood.
41
38
  To call the same tools from an agent, register the MCP proxy:
42
39
  `cia setup claude-code` (or `claude-desktop` / `codex` / `hermes`).
43
40
 
@@ -48,13 +45,8 @@ script needs indented JSON:
48
45
  cia mcp call --json graph_query \
49
46
  network=robinhood \
50
47
  "query=USE topology MATCH (a:Address) RETURN a.address AS address LIMIT 10"
51
- cia workflow aml-address-risk --json \
52
- --address 0xYourAddressHere --network robinhood
53
48
  ```
54
49
 
55
- The AML address-risk contract uses the latest version when `version` is
56
- omitted. Pin the current contract with `--version v1` on the workflow command.
57
-
58
50
  ### Claude plugin
59
51
 
60
52
  The `plugin/` folder is the Chain Insights plugin for Claude. It starts the
@@ -72,9 +64,21 @@ Insights Graph for the data.
72
64
  The plugin needs Node.js 22 or newer. Add this repository as a plugin
73
65
  marketplace, then install the `chain-insights` plugin from it.
74
66
 
75
- Without the plugin, `npm install -g chain-insights` then
76
- `cia setup claude-desktop` registers the installed proxy in Claude Desktop
77
- directly. Restart Claude Desktop afterwards.
67
+ Without the plugin, register the installed proxy in Claude Desktop directly:
68
+
69
+ 1. Quit Claude Desktop fully. Closing the window is not enough: it keeps
70
+ running and writes its settings file back, which can remove the new entry.
71
+ - macOS: Claude menu > Quit Claude (Cmd+Q).
72
+ - Windows: right-click the Claude icon in the taskbar tray > Quit.
73
+ - Linux: File menu > Quit, or the tray icon > Quit.
74
+ 2. Run `npm install -g chain-insights`, then `cia setup claude-desktop`.
75
+ It warns if Claude Desktop is still running.
76
+ 3. Start Claude Desktop. `chain-insights` shows under Settings > Developer.
77
+
78
+ The entry is written to `claude_desktop_config.json` under `mcpServers`:
79
+ `~/Library/Application Support/Claude` on macOS, `%APPDATA%\Claude` on
80
+ Windows, `~/.config/Claude` on Linux. A `.bak` copy of the previous file is
81
+ kept beside it.
78
82
 
79
83
  The plugin skills are copies of `skills/`. After editing a skill, run
80
84
  `node scripts/sync-plugin-skills.mjs`; a test fails while the copies differ.
@@ -92,8 +96,8 @@ Owns:
92
96
 
93
97
  - The `cia` / `chain-insights` CLI and the `chain-insights-mcp-proxy` MCP
94
98
  server (source under `src/`).
95
- - The canonical public tool surface: prefixed `aml_*` / `graph_*` / `meta_*`
96
- / `wallet_*` tools.
99
+ - The canonical public tool surface: prefixed `graph_*` / `meta_*` /
100
+ `wallet_*` tools.
97
101
  - Local wallet and payment on Base mainnet (payment chain only).
98
102
  - Shipped product skills under `skills/` (`chain-insights-*`), packaged
99
103
  into the npm tarball.
@@ -103,8 +107,7 @@ Never touches:
103
107
  - Blockchain indexing, graph database storage, or graph serving — those
104
108
  belong to the Chain Insights Graph backend.
105
109
  - Automatic risk labeling. Address labels are served by the Chain Insights
106
- Graph backend and read through `aml_address_risk`; the CLI never writes
107
- labels.
110
+ Graph backend and read through `graph_query`; the CLI never writes labels.
108
111
  - Custodial wallets or hosted case databases. Investigation data stays with
109
112
  the caller.
110
113
 
@@ -112,7 +115,6 @@ Never touches:
112
115
 
113
116
  | Tool | Use it for |
114
117
  | --------------------------- | ---------------------------------------------------------------------------------- |
115
- | `aml_address_risk` | Screen one address for risk, behavior, neighborhood context, and exchange exposure |
116
118
  | `graph_query` | Run one read-only GQL/Cypher query against a Chain Insights Graph layer |
117
119
  | `graph_query_batch` | Run related read-only graph queries as one MCP call |
118
120
  | `meta_network_capabilities` | Check supported Chain Insights networks and graph tools |
@@ -176,7 +178,7 @@ Graph queries choose the read graph explicitly:
176
178
 
177
179
  | Graph | Use it for |
178
180
  | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
179
- | `topology` | The unified address / FLOWS_TO / OPERATED_BY / LINKED graph — recent and full historical fund-flow traversal, the node `risk_score`/`risk_level` verdict, and swap, liquidity-pool and bridge totals (see [Graph tools](docs/graph-tools.md#swaps-liquidity-pools-and-bridges)) |
181
+ | `topology` | The unified address / FLOWS_TO / OPERATED_BY / LINKED graph — recent and full historical fund-flow traversal, and swap, liquidity-pool and bridge totals (see [Graph tools](docs/graph-tools.md#swaps-liquidity-pools-and-bridges)) |
180
182
  | `facts` | Bounded individual `TRANSFER` rows with amount, `amount_usd`, asset, transaction, and block facts, plus single `SWAP`, `LIQUIDITY_ADD`, `LIQUIDITY_REMOVE` and `BRIDGE_CROSSING` rows |
181
183
 
182
184
  One rule is worth reading before writing a query by hand: the `network`
@@ -187,9 +189,8 @@ on `:Address` without an exact address must scope itself with
187
189
  database and `Address` carries no `network` property at all. See
188
190
  [Graph query compatibility](docs/graph-query-compatibility.md).
189
191
 
190
- Agent installs include `chain-insights-address-risk` for one-address
191
- screens, `chain-insights-cypher` for graph-query dialect rules, and
192
- `chain-insights-schema-evm` for the EVM / Robinhood graph map.
192
+ Agent installs include `chain-insights-cypher` for graph-query dialect rules
193
+ and `chain-insights-schema-evm` for the EVM / Robinhood graph map.
193
194
 
194
195
  ## Billing: Billable Units
195
196
 
@@ -210,19 +211,6 @@ cut off. When you see `truncated: true`:
210
211
  - Page through results with `SKIP` to fetch the next batch.
211
212
  - Add a tighter `WHERE` filter before raising the limit.
212
213
 
213
- **Workflow tools carry a `usage` block.** `aml_address_risk` runs many graph
214
- queries behind the scenes to answer one question. Every response includes a
215
- `usage` block with the total cost of all of them:
216
-
217
- - **`billable_units`** — total units billed across every internal graph
218
- query this workflow ran.
219
- - **`query_count`** — how many internal graph queries it took.
220
- - **`truncated_queries`** — how many of those internal queries hit their
221
- row limit and got cut off.
222
-
223
- Use `usage` to see the real cost of a workflow call, not just of one
224
- `graph_query`.
225
-
226
214
  ## Prerequisites And Environment Setup
227
215
 
228
216
  - **Linux** is the reference platform; shell snippets use bash (macOS works
@@ -255,11 +243,12 @@ cia --version
255
243
  cia update --check
256
244
  ```
257
245
 
258
- Run a first screen from any directory:
246
+ Run a first query from any directory:
259
247
 
260
248
  ```bash
261
- cia workflow aml-address-risk \
262
- --address 0xYourAddressHere --network robinhood
249
+ cia mcp call graph_query \
250
+ network=robinhood \
251
+ "query=USE topology MATCH (a:Address) RETURN a.address AS address LIMIT 10"
263
252
  ```
264
253
 
265
254
  Create a local payment wallet when paid access is needed:
@@ -279,7 +268,7 @@ Example queries. Direct topology:
279
268
  ```bash
280
269
  cia mcp call graph_query \
281
270
  network=robinhood \
282
- "query=USE topology MATCH (a:Address) RETURN a.address AS address, a.network AS network, a.labels AS labels, a.risk_level AS risk_level LIMIT 10"
271
+ "query=USE topology MATCH (a:Address) RETURN a.address AS address, a.network AS network, a.labels AS labels LIMIT 10"
283
272
  ```
284
273
 
285
274
  Batch across graph views:
package/bin/install.cjs CHANGED
@@ -50,11 +50,11 @@ const dataDir = path.join(homeDir, '.chain-insights')
50
50
  const configPath = path.join(dataDir, 'config.json')
51
51
  const srcSkillsDir = path.join(__dirname, '..', 'skills')
52
52
  const PUBLIC_SKILL_NAMES = Object.freeze([
53
- 'chain-insights-address-risk',
54
53
  'chain-insights-cypher',
55
54
  'chain-insights-schema-evm',
56
55
  ])
57
56
  const RETIRED_SKILL_NAMES = Object.freeze([
57
+ 'chain-insights-address-risk',
58
58
  'chain-insights-bittensor-cypher',
59
59
  'chain-insights-developer-experience',
60
60
  'chain-insights-investigation',
@@ -318,8 +318,34 @@ function installClaudeDesktopMcp(configFile, proxyPath) {
318
318
  fs.writeFileSync(configFile, `${JSON.stringify(config, null, 2)}\n`, 'utf8')
319
319
  }
320
320
 
321
+ // Claude Desktop keeps its settings in the same file and writes the whole file
322
+ // back when it saves them, so an entry added while it runs can be lost.
323
+ function claudeDesktopRunning() {
324
+ const { spawnSync } = require('child_process')
325
+ try {
326
+ if (process.platform === 'win32') {
327
+ const out = spawnSync('tasklist', ['/FI', 'IMAGENAME eq Claude.exe', '/NH'], { encoding: 'utf8' })
328
+ return /claude\.exe/i.test(out.stdout || '')
329
+ }
330
+ const pgrepArgs = process.platform === 'darwin' ? ['-x', 'Claude'] : ['-f', '(^|/)claude-desktop( |$)']
331
+ return spawnSync('pgrep', pgrepArgs, { encoding: 'utf8' }).status === 0
332
+ } catch {
333
+ return false
334
+ }
335
+ }
336
+
337
+ function quitClaudeDesktopHint() {
338
+ if (process.platform === 'darwin') return 'Claude menu > Quit Claude (Cmd+Q)'
339
+ if (process.platform === 'win32') return 'right-click the Claude icon in the taskbar tray > Quit'
340
+ return 'File menu > Quit, or the tray icon > Quit'
341
+ }
342
+
321
343
  if (hasClaudeDesktop) {
322
344
  const desktopConfig = claudeDesktopConfigPath()
345
+ if (claudeDesktopRunning()) {
346
+ console.log(` ${bold}Claude Desktop is running.${reset} It can overwrite the new entry when it saves its own settings.`)
347
+ console.log(` Quit it fully (${quitClaudeDesktopHint()}), run ${cyan}cia setup claude-desktop${reset} again, then start Claude Desktop.`)
348
+ }
323
349
  try {
324
350
  installClaudeDesktopMcp(desktopConfig, proxyBinPath)
325
351
  console.log(` ${cyan}Claude Desktop MCP:${reset} registered in ${desktopConfig}`)