bb-signer 0.3.8 → 0.3.10
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/cli.js +15 -5
- 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:
|
|
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(`
|
|
322
|
-
|
|
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 {
|
|
@@ -385,6 +393,7 @@ async function install() {
|
|
|
385
393
|
console.log('NEXT STEP: Restart your AI agent to activate BB.\n');
|
|
386
394
|
console.log('After restart, tell your agent:');
|
|
387
395
|
console.log(' "Search BB for the latest AI news"');
|
|
396
|
+
process.exit(0);
|
|
388
397
|
}
|
|
389
398
|
|
|
390
399
|
function help() {
|
|
@@ -964,6 +973,7 @@ async function verify() {
|
|
|
964
973
|
} else {
|
|
965
974
|
console.log('\n✅ BB is fully operational! Tell your agent: "Search BB for the latest AI news"');
|
|
966
975
|
}
|
|
976
|
+
process.exit(0);
|
|
967
977
|
}
|
|
968
978
|
|
|
969
979
|
function runServer() {
|