@chatpanel/bridge 0.2.8 → 0.2.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/README.md +22 -26
- package/package.json +1 -1
- package/scripts/install.ps1 +29 -14
- package/src/server.js +1 -1
- package/src/service.js +19 -7
package/README.md
CHANGED
|
@@ -14,26 +14,30 @@ the ones the bridge reports as available.
|
|
|
14
14
|
|
|
15
15
|
## Run it
|
|
16
16
|
|
|
17
|
-
###
|
|
17
|
+
### macOS / Linux — one line, no Node.js needed
|
|
18
18
|
|
|
19
|
-
**macOS / Linux:**
|
|
20
19
|
```bash
|
|
21
20
|
curl -fsSL https://dl.chatpanel.net/bridge/install.sh | bash
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
Downloads the standalone binary, installs it, and sets it to start at login
|
|
24
|
+
(installing via curl avoids the macOS "damaged" prompt). Re-running is a clean
|
|
25
|
+
in-place upgrade.
|
|
26
|
+
|
|
27
|
+
### Windows — via Node (recommended)
|
|
28
|
+
|
|
29
|
+
Windows SmartScreen flags unsigned downloads, so on Windows run the bridge through
|
|
30
|
+
Node — you already have it if you use Claude Code / Codex / Gemini (all npm CLIs),
|
|
31
|
+
and there's no security prompt:
|
|
32
|
+
|
|
25
33
|
```powershell
|
|
26
|
-
|
|
34
|
+
npm i -g @chatpanel/bridge
|
|
35
|
+
chatpanel-bridge --install # starts hidden at login
|
|
27
36
|
```
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
start at login. **Recommended** — installing this way avoids the macOS "damaged"
|
|
31
|
-
and Windows SmartScreen prompts that browser downloads trigger. Re-running it is a
|
|
32
|
-
clean in-place upgrade (no duplicate installs). Then open the ChatPanel side panel
|
|
33
|
-
and your agents appear.
|
|
38
|
+
Just trying it? `npx @chatpanel/bridge` runs it once in the foreground.
|
|
34
39
|
|
|
35
|
-
Manage it: `chatpanel-bridge --status` · `--uninstall
|
|
36
|
-
once in the foreground.
|
|
40
|
+
Manage it anywhere: `chatpanel-bridge --status` · `--uninstall`.
|
|
37
41
|
|
|
38
42
|
### Manual download
|
|
39
43
|
|
|
@@ -50,25 +54,17 @@ chmod +x chatpanel-bridge-macos-arm64
|
|
|
50
54
|
.\chatpanel-bridge-windows-x64.exe --install
|
|
51
55
|
```
|
|
52
56
|
|
|
53
|
-
> These binaries aren't
|
|
54
|
-
>
|
|
55
|
-
>
|
|
56
|
-
> **Intel Mac?** No x64 binary yet — use **Option B** (`npx @chatpanel/bridge`).
|
|
57
|
-
> Apple Silicon (`uname -m` → `arm64`) uses `chatpanel-bridge-macos-arm64`.
|
|
58
|
-
|
|
59
|
-
### Option B — via npm (needs Node.js 18+)
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npx @chatpanel/bridge # → http://127.0.0.1:4319
|
|
63
|
-
```
|
|
57
|
+
> These binaries aren't code-signed yet, so macOS/Windows may warn on first run
|
|
58
|
+
> (the curl/npm routes above sidestep that). **Intel Mac?** No x64 binary yet —
|
|
59
|
+
> use npm (`npx @chatpanel/bridge`). Apple Silicon uses `chatpanel-bridge-macos-arm64`.
|
|
64
60
|
|
|
65
|
-
|
|
66
|
-
command? `npm i -g @chatpanel/bridge` then `chatpanel-bridge`.
|
|
61
|
+
### Prerequisites
|
|
67
62
|
|
|
68
|
-
|
|
63
|
+
The agents you want to use must already be set up:
|
|
69
64
|
|
|
70
|
-
- **Claude Code**:
|
|
65
|
+
- **Claude Code**: installed and signed in (`claude`), or set `ANTHROPIC_API_KEY`.
|
|
71
66
|
- **Codex**: `codex` on your `PATH` and `codex login` done.
|
|
67
|
+
- **Gemini CLI**: `gemini` on your `PATH` and signed in.
|
|
72
68
|
|
|
73
69
|
The extension polls `/health` and shows each agent as available/unavailable.
|
|
74
70
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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/scripts/install.ps1
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# ChatPanel Bridge installer (Windows) - no Node.js required.
|
|
2
2
|
#
|
|
3
3
|
# irm https://dl.chatpanel.net/bridge/install.ps1 | iex
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
#
|
|
5
|
+
# Note: no `$ErrorActionPreference = 'Stop'` here, because native tools (schtasks,
|
|
6
|
+
# curl) write progress/notices to stderr and that would be treated as fatal. We
|
|
7
|
+
# check exit codes explicitly instead.
|
|
8
|
+
$ProgressPreference = 'SilentlyContinue'
|
|
6
9
|
|
|
7
10
|
$url = 'https://dl.chatpanel.net/bridge/windows-x64.exe'
|
|
8
11
|
$dir = Join-Path $env:LOCALAPPDATA 'ChatPanel'
|
|
@@ -12,28 +15,40 @@ $tmp = "$bin.new"
|
|
|
12
15
|
Write-Host ""
|
|
13
16
|
Write-Host "Installing ChatPanel Bridge" -ForegroundColor Cyan
|
|
14
17
|
|
|
15
|
-
# Stop any running bridge + its scheduled task
|
|
16
|
-
#
|
|
17
|
-
schtasks /End /TN ChatPanelBridge
|
|
18
|
+
# Stop any running bridge + its scheduled task for a clean in-place upgrade.
|
|
19
|
+
# Run schtasks inside cmd so its "not found" stderr never reaches PowerShell.
|
|
20
|
+
cmd /c "schtasks /End /TN ChatPanelBridge >nul 2>&1"
|
|
18
21
|
Get-Process -Name 'chatpanel-bridge' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
|
|
19
22
|
Start-Sleep -Milliseconds 600
|
|
20
23
|
|
|
21
24
|
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
22
25
|
|
|
23
26
|
Write-Host " Downloading the bridge (~60 MB)..." -ForegroundColor Gray
|
|
24
|
-
$
|
|
25
|
-
if (
|
|
26
|
-
& curl.exe -fL --progress-bar -o $tmp $url # fast,
|
|
27
|
+
$ok = $false
|
|
28
|
+
if (Get-Command curl.exe -ErrorAction SilentlyContinue) {
|
|
29
|
+
& curl.exe -fL --progress-bar -o "$tmp" "$url" # fast, real progress bar
|
|
30
|
+
$ok = ($LASTEXITCODE -eq 0)
|
|
27
31
|
} else {
|
|
28
|
-
Invoke-WebRequest -Uri $url -OutFile $tmp -UseBasicParsing
|
|
32
|
+
try { Invoke-WebRequest -Uri $url -OutFile $tmp -UseBasicParsing; $ok = $true } catch { $ok = $false }
|
|
33
|
+
}
|
|
34
|
+
if (-not $ok -or -not (Test-Path "$tmp")) {
|
|
35
|
+
Write-Host "Download failed - check your connection and re-run." -ForegroundColor Red
|
|
36
|
+
return
|
|
29
37
|
}
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
|
|
39
|
+
Unblock-File -Path "$tmp" -ErrorAction SilentlyContinue # no SmartScreen mark-of-the-web
|
|
40
|
+
Move-Item -Force "$tmp" "$bin"
|
|
32
41
|
|
|
33
42
|
Write-Host " Setting it to start at login..." -ForegroundColor Gray
|
|
34
|
-
& $bin --install
|
|
43
|
+
& "$bin" --install
|
|
44
|
+
$installed = ($LASTEXITCODE -eq 0)
|
|
35
45
|
|
|
36
46
|
Write-Host ""
|
|
37
|
-
|
|
38
|
-
Write-Host "
|
|
47
|
+
if ($installed) {
|
|
48
|
+
Write-Host "Done. ChatPanel Bridge is running and starts at login." -ForegroundColor Green
|
|
49
|
+
Write-Host "Open the ChatPanel side panel - your agents appear automatically."
|
|
50
|
+
} else {
|
|
51
|
+
Write-Host "Installed, but auto-start setup hit an issue. Start it manually with:" -ForegroundColor Yellow
|
|
52
|
+
Write-Host " `"$bin`""
|
|
53
|
+
}
|
|
39
54
|
Write-Host "Manage it: `"$bin`" --status | --uninstall"
|
package/src/server.js
CHANGED
|
@@ -22,7 +22,7 @@ import * as gemini from './engines/gemini.js';
|
|
|
22
22
|
import { installService, uninstallService, serviceStatus } from './service.js';
|
|
23
23
|
import { enrichPath, findAgentBin } from './env.js';
|
|
24
24
|
|
|
25
|
-
const VERSION = '0.2.
|
|
25
|
+
const VERSION = '0.2.10';
|
|
26
26
|
const HOST = process.env.CHATPANEL_BRIDGE_HOST || '127.0.0.1';
|
|
27
27
|
const PORT = Number(process.env.CHATPANEL_BRIDGE_PORT) || 4319;
|
|
28
28
|
|
package/src/service.js
CHANGED
|
@@ -79,20 +79,32 @@ function macStatus() {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// ---------------------------------------------------------------- Windows
|
|
82
|
-
|
|
82
|
+
// Per-user auto-start via the HKCU Run key — works without admin (a scheduled
|
|
83
|
+
// task can be blocked by policy: "Access is denied"). A tiny .vbs launcher runs
|
|
84
|
+
// the bridge with NO console window.
|
|
85
|
+
const WIN_RUN_KEY = 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run';
|
|
86
|
+
const WIN_RUN_NAME = 'ChatPanelBridge';
|
|
87
|
+
// A user-writable location for the launcher. NOT next to the program — under
|
|
88
|
+
// `npm i -g` the program is node.exe, whose dir is protected (EPERM).
|
|
89
|
+
const winVbs = () => path.join(os.homedir(), '.chatpanel', 'launch.vbs');
|
|
83
90
|
|
|
84
91
|
function winInstall() {
|
|
85
92
|
const { program, args } = resolveLaunch();
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
// VBS quoting: "" is a literal quote inside a string. Run(cmd, 0=hidden, False).
|
|
94
|
+
const parts = [program, ...args].map((p) => `""${p}""`).join(' ');
|
|
95
|
+
const vbs = winVbs();
|
|
96
|
+
mkdirSync(path.dirname(vbs), { recursive: true });
|
|
97
|
+
writeFileSync(vbs, `CreateObject("WScript.Shell").Run "${parts}", 0, False\r\n`);
|
|
98
|
+
const r = run('reg', ['add', WIN_RUN_KEY, '/v', WIN_RUN_NAME, '/t', 'REG_SZ', '/d', `wscript.exe "${vbs}"`, '/f']);
|
|
99
|
+
if (r.status !== 0) throw new Error((r.stderr || '').trim() || 'reg add failed');
|
|
100
|
+
run('wscript.exe', [vbs]); // start now, hidden
|
|
90
101
|
}
|
|
91
102
|
function winUninstall() {
|
|
92
|
-
run('
|
|
103
|
+
run('reg', ['delete', WIN_RUN_KEY, '/v', WIN_RUN_NAME, '/f']);
|
|
104
|
+
run('taskkill', ['/IM', 'chatpanel-bridge.exe', '/F']);
|
|
93
105
|
}
|
|
94
106
|
function winStatus() {
|
|
95
|
-
return run('
|
|
107
|
+
return run('reg', ['query', WIN_RUN_KEY, '/v', WIN_RUN_NAME]).status === 0;
|
|
96
108
|
}
|
|
97
109
|
|
|
98
110
|
// ---------------------------------------------------------------- Linux (systemd user)
|