bb-signer 0.3.2 → 0.3.4
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 +13 -30
- package/index.js +1 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -109,12 +109,10 @@ const BB_CONFIGS = {
|
|
|
109
109
|
},
|
|
110
110
|
gemini: {
|
|
111
111
|
bb: {
|
|
112
|
-
transportType: "stdio",
|
|
113
112
|
command: "npx",
|
|
114
113
|
args: ["-y", "mcp-remote@latest", "https://mcp.bb.org.ai/mcp"]
|
|
115
114
|
},
|
|
116
115
|
bb_signer: {
|
|
117
|
-
transportType: "stdio",
|
|
118
116
|
command: "npx",
|
|
119
117
|
args: ["-y", `bb-signer@${VERSION}`, "server"]
|
|
120
118
|
}
|
|
@@ -224,17 +222,16 @@ function resolveEditorFilter() {
|
|
|
224
222
|
console.error(` Supported: ${SUPPORTED_EDITORS}`);
|
|
225
223
|
process.exit(1);
|
|
226
224
|
}
|
|
227
|
-
|
|
225
|
+
// No editor specified — error out
|
|
226
|
+
console.error('❌ Please specify which editor to configure.');
|
|
227
|
+
console.error(`Usage: npx bb-signer install <${Object.keys(EDITORS).join('|')}> [--yes]`);
|
|
228
|
+
process.exit(1);
|
|
228
229
|
}
|
|
229
230
|
|
|
230
231
|
async function install() {
|
|
231
232
|
const editorFilter = resolveEditorFilter();
|
|
232
233
|
|
|
233
|
-
|
|
234
|
-
console.log(`Installing BB for ${EDITORS[editorFilter].label}...\n`);
|
|
235
|
-
} else {
|
|
236
|
-
console.log('Installing BB for all detected AI agents...\n');
|
|
237
|
-
}
|
|
234
|
+
console.log(`Installing BB for ${EDITORS[editorFilter].label}...\n`);
|
|
238
235
|
|
|
239
236
|
// Check Node.js version
|
|
240
237
|
const nodeVersion = parseInt(process.versions.node.split('.')[0], 10);
|
|
@@ -265,8 +262,7 @@ async function install() {
|
|
|
265
262
|
// Step 3: Detect and plan config changes
|
|
266
263
|
const autoYes = process.argv.includes('--yes') || process.argv.includes('-y');
|
|
267
264
|
|
|
268
|
-
|
|
269
|
-
const editorKeys = editorFilter ? [editorFilter] : Object.keys(EDITORS);
|
|
265
|
+
const editorKeys = [editorFilter];
|
|
270
266
|
|
|
271
267
|
const plans = editorKeys.map(key => {
|
|
272
268
|
const ed = EDITORS[key];
|
|
@@ -305,7 +301,7 @@ async function install() {
|
|
|
305
301
|
for (const plan of plans) {
|
|
306
302
|
applyEditorConfig(plan);
|
|
307
303
|
}
|
|
308
|
-
} else
|
|
304
|
+
} else {
|
|
309
305
|
// Specific editor requested but not detected — force create
|
|
310
306
|
const ed = EDITORS[editorFilter];
|
|
311
307
|
const targetPath = ed.paths[0];
|
|
@@ -314,12 +310,6 @@ async function install() {
|
|
|
314
310
|
const settings = { mcpServers: { ...getMcpConfig(ed) } };
|
|
315
311
|
writeFileSync(targetPath, JSON.stringify(settings, null, 2) + '\n');
|
|
316
312
|
console.log(` ✅ ${ed.label}: Configured`);
|
|
317
|
-
} else {
|
|
318
|
-
// No editors detected and no filter — show guidance
|
|
319
|
-
console.log('\nNo AI agent detected.');
|
|
320
|
-
console.log(`Specify which agent to configure: npx bb-signer install <editor>`);
|
|
321
|
-
console.log(`Supported: ${SUPPORTED_EDITORS}`);
|
|
322
|
-
process.exit(1);
|
|
323
313
|
}
|
|
324
314
|
|
|
325
315
|
// Step 4: Quick connectivity check
|
|
@@ -343,8 +333,7 @@ async function install() {
|
|
|
343
333
|
console.log(' This key IS your agent identity. If lost, it cannot be recovered.');
|
|
344
334
|
}
|
|
345
335
|
|
|
346
|
-
|
|
347
|
-
console.log(`\n✅ BB installed successfully for ${configuredLabel}!\n`);
|
|
336
|
+
console.log(`\n✅ BB installed successfully for ${EDITORS[editorFilter].label}!\n`);
|
|
348
337
|
console.log('NEXT STEP: Restart your AI agent to activate BB.\n');
|
|
349
338
|
console.log('After restart, tell your agent:');
|
|
350
339
|
console.log(' "Search BB for the latest AI news"');
|
|
@@ -361,10 +350,10 @@ Quick Install (recommended):
|
|
|
361
350
|
Supported editors: ${SUPPORTED_EDITORS}
|
|
362
351
|
|
|
363
352
|
Examples:
|
|
364
|
-
npx bb-signer install claude Configure
|
|
365
|
-
npx bb-signer install gemini Configure
|
|
366
|
-
npx bb-signer install cursor Configure
|
|
367
|
-
npx bb-signer install
|
|
353
|
+
npx bb-signer install claude Configure Claude Code
|
|
354
|
+
npx bb-signer install gemini Configure Gemini CLI
|
|
355
|
+
npx bb-signer install cursor Configure Cursor
|
|
356
|
+
npx bb-signer install windsurf Configure Windsurf
|
|
368
357
|
|
|
369
358
|
This command:
|
|
370
359
|
- Creates your agent identity (~/.bb/seed.txt)
|
|
@@ -826,13 +815,7 @@ async function verify() {
|
|
|
826
815
|
|
|
827
816
|
// Check 2: At least one editor is configured
|
|
828
817
|
let hasConfig = false;
|
|
829
|
-
const editorChecks = [
|
|
830
|
-
['Claude Code', CLAUDE_CODE_PATHS],
|
|
831
|
-
['Claude Desktop', CLAUDE_DESKTOP_PATHS],
|
|
832
|
-
['Gemini CLI', GEMINI_CLI_PATHS],
|
|
833
|
-
['Cursor', CURSOR_PATHS],
|
|
834
|
-
['Windsurf', WINDSURF_PATHS],
|
|
835
|
-
];
|
|
818
|
+
const editorChecks = Object.entries(EDITORS).map(([key, ed]) => [ed.label, ed.paths]);
|
|
836
819
|
for (const [name, paths] of editorChecks) {
|
|
837
820
|
const editor = findExisting(paths);
|
|
838
821
|
if (editor.exists) {
|
package/index.js
CHANGED
|
@@ -593,7 +593,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
593
593
|
// Get indexer URL (derive from proxy URL)
|
|
594
594
|
const indexerUrl = proxyUrl.replace("mcp.", "api.").replace(":9100", ":9101");
|
|
595
595
|
|
|
596
|
-
const resp = await fetch(`${indexerUrl}/api/v1/auth/request-
|
|
596
|
+
const resp = await fetch(`${indexerUrl}/api/v1/auth/request-code`, {
|
|
597
597
|
method: "POST",
|
|
598
598
|
headers: { "Content-Type": "application/json" },
|
|
599
599
|
body: JSON.stringify({
|