bb-signer 0.3.8 → 0.3.9

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.
Files changed (2) hide show
  1. package/cli.js +13 -5
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -49,13 +49,14 @@ function hasClaude() {
49
49
 
50
50
  function installViaClaude(mcpConfig) {
51
51
  // Remove existing servers first (ignore errors if they don't exist)
52
+ // Timeout prevents hanging when run from within a Claude Code session
52
53
  for (const name of Object.keys(mcpConfig)) {
53
- try { execSync(`claude mcp remove ${name}`, { stdio: 'pipe' }); } catch {}
54
+ try { execSync(`claude mcp remove ${name}`, { stdio: 'pipe', timeout: 15000 }); } catch {}
54
55
  }
55
56
  // Add servers
56
57
  for (const [name, config] of Object.entries(mcpConfig)) {
57
58
  const args = config.args.map(a => `"${a}"`).join(' ');
58
- execSync(`claude mcp add ${name} -- ${config.command} ${args}`, { stdio: 'pipe' });
59
+ execSync(`claude mcp add ${name} -- ${config.command} ${args}`, { stdio: 'pipe', timeout: 15000 });
59
60
  }
60
61
  }
61
62
 
@@ -311,15 +312,22 @@ async function install() {
311
312
  const ed = EDITORS[editorFilter];
312
313
  const mcpConfig = getMcpConfig(ed);
313
314
 
314
- // For Claude Code: use `claude mcp add` (settings.json alone doesn't work)
315
+ // For Claude Code: try `claude mcp add`, always also write settings.json as fallback.
316
+ // `claude mcp add` can hang when run from within a Claude Code bash session,
317
+ // so the settings.json write ensures config is always persisted.
315
318
  if (ed.usesCli && hasClaude()) {
316
319
  console.log('\nConfiguring via Claude CLI...');
317
320
  try {
318
321
  installViaClaude(mcpConfig);
319
322
  console.log(` ✅ ${ed.label}: Configured via \`claude mcp add\``);
320
323
  } catch (e) {
321
- console.error(` claude mcp add failed: ${e.message}`);
322
- console.error(' Falling back to settings.json...');
324
+ console.error(` ⚠️ \`claude mcp add\` failed: ${e.message}`);
325
+ }
326
+ // Always also write settings.json — belt and suspenders
327
+ const plan = planEditorConfig(ed.label, ed.paths, mcpConfig, ed.detectDirs);
328
+ if (plan) {
329
+ applyEditorConfig(plan);
330
+ } else {
323
331
  fallbackToSettingsFile(ed, mcpConfig);
324
332
  }
325
333
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-signer",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Minimal local signer for BB - signs events for the agent collaboration network",
5
5
  "type": "module",
6
6
  "main": "index.js",