chain-insights 0.42.2 → 0.43.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/README.md CHANGED
@@ -61,8 +61,9 @@ The `plugin/` folder is the Chain Insights plugin for Claude. It starts the
61
61
  local Chain Insights MCP proxy on your computer over stdio
62
62
  (`chain-insights-mcp-proxy` from the npm package, through `npx`), and brings the
63
63
  `chain-insights-cypher` and `chain-insights-schema-evm` skills. The proxy
64
- serves the money-flow, query-table and balance views itself, and reaches the
65
- Chain Insights Graph for the data.
64
+ serves the views itself (a graph, a chart or a table, picked from the column
65
+ names of a `graph_query` answer, and the balance), and reaches the Chain
66
+ Insights Graph for the data.
66
67
 
67
68
  - **Runs in:** Claude Desktop, Cowork sessions on your computer, and Claude Code.
68
69
  - **Cannot start it:** claude.ai on the web, the Claude mobile apps and Cowork
@@ -71,9 +72,21 @@ Chain Insights Graph for the data.
71
72
  The plugin needs Node.js 22 or newer. Add this repository as a plugin
72
73
  marketplace, then install the `chain-insights` plugin from it.
73
74
 
74
- Without the plugin, `npm install -g chain-insights` then
75
- `cia setup claude-desktop` registers the installed proxy in Claude Desktop
76
- directly. Restart Claude Desktop afterwards.
75
+ Without the plugin, register the installed proxy in Claude Desktop directly:
76
+
77
+ 1. Quit Claude Desktop fully. Closing the window is not enough: it keeps
78
+ running and writes its settings file back, which can remove the new entry.
79
+ - macOS: Claude menu > Quit Claude (Cmd+Q).
80
+ - Windows: right-click the Claude icon in the taskbar tray > Quit.
81
+ - Linux: File menu > Quit, or the tray icon > Quit.
82
+ 2. Run `npm install -g chain-insights`, then `cia setup claude-desktop`.
83
+ It warns if Claude Desktop is still running.
84
+ 3. Start Claude Desktop. `chain-insights` shows under Settings > Developer.
85
+
86
+ The entry is written to `claude_desktop_config.json` under `mcpServers`:
87
+ `~/Library/Application Support/Claude` on macOS, `%APPDATA%\Claude` on
88
+ Windows, `~/.config/Claude` on Linux. A `.bak` copy of the previous file is
89
+ kept beside it.
77
90
 
78
91
  The plugin skills are copies of `skills/`. After editing a skill, run
79
92
  `node scripts/sync-plugin-skills.mjs`; a test fails while the copies differ.
package/bin/install.cjs CHANGED
@@ -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}`)