chain-insights 0.50.0 → 0.52.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/bin/install.cjs CHANGED
@@ -50,6 +50,7 @@ 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(['chain-insights-cypher'])
53
+ const SKILL_VERSION_FILE = '.chain-insights-version'
53
54
  const RETIRED_SKILL_NAMES = Object.freeze([
54
55
  'chain-insights-address-risk',
55
56
  'chain-insights-bittensor-cypher',
@@ -117,6 +118,8 @@ function copyCommandsAsClaudeSkills(srcDir, targetDir) {
117
118
  }
118
119
  fs.rmSync(skillDest, { recursive: true, force: true })
119
120
  copyTree(skillSrc, skillDest)
121
+ // The proxy refreshes a copy whose stamp is older than itself (src/skill-refresh.ts).
122
+ fs.writeFileSync(path.join(skillDest, SKILL_VERSION_FILE), `${packageVersion()}\n`, 'utf8')
120
123
  }
121
124
  }
122
125
 
@@ -153,15 +156,35 @@ const { execFileSync } = require('child_process')
153
156
 
154
157
  if (hasClaude) {
155
158
  try {
159
+ // "add" refuses a name that exists, so an entry from an older install (or
160
+ // an old checkout) would stay in place. Replace it. The proxy is started
161
+ // with this Node's absolute path: Claude Desktop runs Claude Code without
162
+ // a shell's PATH.
163
+ try {
164
+ execFileSync('claude', ['mcp', 'remove', 'chain-insights-proxy', '--scope', 'user'], {
165
+ stdio: 'pipe',
166
+ })
167
+ } catch {
168
+ /* not registered yet */
169
+ }
156
170
  execFileSync(
157
171
  'claude',
158
- ['mcp', 'add', 'chain-insights-proxy', '--scope', 'user', '--', 'node', proxyBinPath],
172
+ [
173
+ 'mcp',
174
+ 'add',
175
+ 'chain-insights-proxy',
176
+ '--scope',
177
+ 'user',
178
+ '--',
179
+ process.execPath,
180
+ proxyBinPath,
181
+ ],
159
182
  { stdio: 'pipe' }
160
183
  )
161
184
  console.log(` ${cyan}Claude MCP:${reset} registered (chain-insights-proxy) at ${proxyBinPath}`)
162
185
  } catch {
163
186
  console.log(
164
- ` ${dim}Claude MCP:${reset} run manually: claude mcp add chain-insights-proxy --scope user -- node ${proxyBinPath}`
187
+ ` ${dim}Claude MCP:${reset} run manually: claude mcp remove chain-insights-proxy --scope user; claude mcp add chain-insights-proxy --scope user -- ${process.execPath} ${proxyBinPath}`
165
188
  )
166
189
  }
167
190
  }