@chatpanel/bridge 0.2.2 → 0.2.3
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/README.md +3 -0
- package/package.json +1 -1
- package/src/env.js +24 -0
- package/src/server.js +1 -1
package/README.md
CHANGED
|
@@ -36,6 +36,9 @@ to start it once in the foreground instead.
|
|
|
36
36
|
|
|
37
37
|
> Until these binaries are code-signed, macOS Gatekeeper / Windows SmartScreen may
|
|
38
38
|
> warn on first run (on macOS, right-click the file → **Open**). Signing is on the way.
|
|
39
|
+
>
|
|
40
|
+
> **Intel Mac?** There's no x64 binary yet — use **Option B** (`npx @chatpanel/bridge`).
|
|
41
|
+
> Apple Silicon (`uname -m` → `arm64`) uses `chatpanel-bridge-macos-arm64`.
|
|
39
42
|
|
|
40
43
|
### Option B — via npm (needs Node.js 18+)
|
|
41
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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/env.js
CHANGED
|
@@ -8,9 +8,32 @@
|
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import { spawnSync } from 'node:child_process';
|
|
11
|
+
import { readdirSync } from 'node:fs';
|
|
11
12
|
|
|
12
13
|
let enriched = false;
|
|
13
14
|
|
|
15
|
+
// Version managers install CLIs under versioned bin dirs that a lazy-loaded
|
|
16
|
+
// shell (nvm/fnm) doesn't export into a non-interactive service PATH. Add them.
|
|
17
|
+
function versionManagerBins(home) {
|
|
18
|
+
const bins = [];
|
|
19
|
+
const tryDir = (dir, sub) => {
|
|
20
|
+
try {
|
|
21
|
+
for (const v of readdirSync(dir)) bins.push(path.join(dir, v, sub));
|
|
22
|
+
} catch {
|
|
23
|
+
/* dir absent */
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
// nvm: ~/.nvm/versions/node/<v>/bin
|
|
27
|
+
tryDir(path.join(process.env.NVM_DIR || path.join(home, '.nvm'), 'versions', 'node'), 'bin');
|
|
28
|
+
// fnm: ~/.local/share/fnm/node-versions/<v>/installation/bin (+ macOS app-support)
|
|
29
|
+
tryDir(path.join(home, '.local', 'share', 'fnm', 'node-versions'), path.join('installation', 'bin'));
|
|
30
|
+
tryDir(path.join(home, 'Library', 'Application Support', 'fnm', 'node-versions'), path.join('installation', 'bin'));
|
|
31
|
+
// volta / asdf shims
|
|
32
|
+
bins.push(path.join(home, '.volta', 'bin'));
|
|
33
|
+
bins.push(path.join(home, '.asdf', 'shims'));
|
|
34
|
+
return bins;
|
|
35
|
+
}
|
|
36
|
+
|
|
14
37
|
export function enrichPath() {
|
|
15
38
|
if (enriched || process.platform === 'win32') {
|
|
16
39
|
enriched = true;
|
|
@@ -33,6 +56,7 @@ export function enrichPath() {
|
|
|
33
56
|
path.join(home, '.cargo', 'bin'),
|
|
34
57
|
path.join(home, '.deno', 'bin'),
|
|
35
58
|
path.join(home, '.bun', 'bin'),
|
|
59
|
+
...versionManagerBins(home),
|
|
36
60
|
];
|
|
37
61
|
|
|
38
62
|
// Ask the user's login shell for its PATH — captures nvm / Homebrew / asdf, etc.
|
package/src/server.js
CHANGED
|
@@ -21,7 +21,7 @@ import * as gemini from './engines/gemini.js';
|
|
|
21
21
|
import { installService, uninstallService, serviceStatus } from './service.js';
|
|
22
22
|
import { enrichPath } from './env.js';
|
|
23
23
|
|
|
24
|
-
const VERSION = '0.2.
|
|
24
|
+
const VERSION = '0.2.3';
|
|
25
25
|
const HOST = process.env.CHATPANEL_BRIDGE_HOST || '127.0.0.1';
|
|
26
26
|
const PORT = Number(process.env.CHATPANEL_BRIDGE_PORT) || 4319;
|
|
27
27
|
|