@chatpanel/bridge 0.10.38 → 0.10.39
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/package.json +1 -1
- package/src/engines/custom.js +14 -3
- package/src/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.39",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local bridge that exposes the AI coding agents installed on your machine \u2014 Claude Code (CLI), Codex (CLI), and Antigravity CLI (formerly Gemini CLI, which remains available for business/enterprise) \u2014 to the ChatPanel Chrome extension over a localhost SSE endpoint. Bring your own agent.",
|
|
6
6
|
"keywords": [
|
package/src/engines/custom.js
CHANGED
|
@@ -333,18 +333,23 @@ async function runStableMcpSetup(plan, cwd) {
|
|
|
333
333
|
let child;
|
|
334
334
|
try { child = spawn(bin, argv, opts); } catch (e) { return reject(new Error(`Failed to start ${plan.command}: ${e.message}`)); }
|
|
335
335
|
let stderr = '';
|
|
336
|
+
// The CLI often reports WHY it couldn't register on stdout while still exiting 0 (Hermes
|
|
337
|
+
// prints "requires the 'mcp' Python SDK" and saves nothing). Capturing it is what lets
|
|
338
|
+
// the caller turn a silent no-op into an actionable message.
|
|
339
|
+
let stdout = '';
|
|
336
340
|
const timer = setTimeout(() => {
|
|
337
341
|
child.kill('SIGKILL');
|
|
338
342
|
reject(new Error(`${plan.command} MCP setup timed out.`));
|
|
339
343
|
}, 20_000);
|
|
340
344
|
child.stderr.on('data', (d) => (stderr += d.toString()));
|
|
345
|
+
child.stdout?.on('data', (d) => (stdout += d.toString()));
|
|
341
346
|
child.on('error', (e) => {
|
|
342
347
|
clearTimeout(timer);
|
|
343
348
|
reject(new Error(`Failed to start ${plan.command}: ${e.message}`));
|
|
344
349
|
});
|
|
345
350
|
child.on('close', (code) => {
|
|
346
351
|
clearTimeout(timer);
|
|
347
|
-
if (code === 0) return resolve();
|
|
352
|
+
if (code === 0) return resolve(`${stdout}\n${stderr}`.trim());
|
|
348
353
|
reject(new Error(`${plan.command} MCP setup exited ${code}: ${stderr.trim().split('\n').pop() || 'failed'}`));
|
|
349
354
|
});
|
|
350
355
|
try { child.stdin.end(); } catch { /* ignore */ }
|
|
@@ -386,9 +391,15 @@ export async function ensureStableMcpConfig(spec, cwd, label, emit, deps = {}) {
|
|
|
386
391
|
}
|
|
387
392
|
|
|
388
393
|
emit({ type: 'status', text: `${label} is setting up one-time browser tools...` });
|
|
389
|
-
|
|
394
|
+
// Keep what the CLI said: it commonly exits 0 while refusing to register (no MCP SDK, no
|
|
395
|
+
// HTTP transport), and that sentence is the only accurate explanation available.
|
|
396
|
+
const setupOutput = String((await runSetup(plan, cwd)) || '').trim();
|
|
390
397
|
if (await hasConfig(spec, cwd)) return true;
|
|
391
|
-
throw new Error(
|
|
398
|
+
throw new Error(
|
|
399
|
+
`${label} browser-tool setup did not register the server.`
|
|
400
|
+
+ (setupOutput ? ` ${setupOutput.split('\n').filter(Boolean).slice(-3).join(' ')}` : '')
|
|
401
|
+
+ ` Run: ${setupCommand}`,
|
|
402
|
+
);
|
|
392
403
|
}
|
|
393
404
|
|
|
394
405
|
export async function chat({ messages, system, options, images }, emit, { signal } = {}) {
|
package/src/server.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
// Hardcoded (not read from package.json) so it survives Bun's single-file
|
|
68
68
|
// --compile, where package.json isn't on a readable FS. CI fails the publish if
|
|
69
69
|
// this drifts from package.json, so the two can't silently diverge.
|
|
70
|
-
const VERSION = '0.10.
|
|
70
|
+
const VERSION = '0.10.39';
|
|
71
71
|
const HOST = process.env.CHATPANEL_BRIDGE_HOST || '127.0.0.1';
|
|
72
72
|
const PORT = Number(process.env.CHATPANEL_BRIDGE_PORT) || 4319;
|
|
73
73
|
|