@chatpanel/bridge 0.2.10 → 0.2.11
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/claude.js +15 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local bridge that exposes the AI coding agents installed on your machine — Claude Code (Agent SDK), Codex (CLI), and Gemini CLI — to the ChatPanel Chrome extension over a localhost SSE endpoint. Bring your own agent.",
|
|
6
6
|
"keywords": [
|
package/src/engines/claude.js
CHANGED
|
@@ -29,11 +29,22 @@ function claudeExecutable() {
|
|
|
29
29
|
const bin = findAgentBin('claude');
|
|
30
30
|
if (!bin) return undefined;
|
|
31
31
|
const dir = path.dirname(bin);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
// The npm install ships cli.js; the native installer ships cli-wrapper.cjs
|
|
33
|
+
// (a JS entry next to a platform binary). Prefer either runnable JS entry over
|
|
34
|
+
// the native `claude` binary, since the SDK runs it with its own JS runtime.
|
|
35
|
+
const pkgDirs = [
|
|
36
|
+
path.join(dir, 'node_modules', '@anthropic-ai', 'claude-code'),
|
|
37
|
+
path.join(dir, '..', 'lib', 'node_modules', '@anthropic-ai', 'claude-code'),
|
|
38
|
+
// npm global on macOS/Homebrew symlinks bin/claude → ../lib/node_modules/...,
|
|
39
|
+
// so dir is already the package's own bin/ in the native install.
|
|
40
|
+
path.join(dir, '..'),
|
|
35
41
|
];
|
|
36
|
-
for (const
|
|
42
|
+
for (const p of pkgDirs) {
|
|
43
|
+
for (const entry of ['cli.js', 'cli-wrapper.cjs']) {
|
|
44
|
+
const c = path.join(p, entry);
|
|
45
|
+
if (existsSync(c)) return c;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
37
48
|
return bin;
|
|
38
49
|
}
|
|
39
50
|
|