@chatpanel/bridge 0.2.4 → 0.2.6

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 CHANGED
@@ -14,30 +14,39 @@ the ones the bridge reports as available.
14
14
 
15
15
  ## Run it
16
16
 
17
- ### Option A — download the app (no Node.js needed)
17
+ ### Option A — one-line install (macOS / Linux, no Node.js needed)
18
18
 
19
- Grab the standalone binary for your OS from the
20
- [latest release](https://github.com/chatpanel/chatpanel-bridge/releases/latest)
21
- it bundles its own runtime, so **nothing to install**. Run it once to set it up to
22
- start automatically at login and run in the background:
19
+ ```bash
20
+ curl -fsSL https://raw.githubusercontent.com/chatpanel/chatpanel-bridge/main/scripts/install.sh | bash
21
+ ```
22
+
23
+ This downloads the standalone binary for your OS, installs it to `~/.local/bin`,
24
+ and sets it to start at login. **Recommended** — installing via curl avoids the
25
+ macOS "damaged / unidentified developer" prompt that browser downloads trigger.
26
+ Then open the ChatPanel side panel and your agents appear.
27
+
28
+ Manage it: `chatpanel-bridge --status` · `--uninstall` · run with no flags to start
29
+ once in the foreground.
30
+
31
+ ### Manual download
32
+
33
+ Grab the binary from the
34
+ [latest release](https://github.com/chatpanel/chatpanel-bridge/releases/latest) and:
23
35
 
24
36
  ```bash
25
- # macOS / Linux (make it executable first on macOS)
37
+ # macOS (clear the download quarantine first, then install)
38
+ xattr -cr chatpanel-bridge-macos-arm64
26
39
  chmod +x chatpanel-bridge-macos-arm64
27
40
  ./chatpanel-bridge-macos-arm64 --install
28
41
 
29
- # Windows (PowerShell)
42
+ # Windows (PowerShell) — click "More info → Run anyway" if SmartScreen warns
30
43
  .\chatpanel-bridge-windows-x64.exe --install
31
44
  ```
32
45
 
33
- That's it open the ChatPanel side panel and your agents appear. Manage it with
34
- `--status` (is it set up?) and `--uninstall` (remove auto-start). Run with no flags
35
- to start it once in the foreground instead.
36
-
37
- > Until these binaries are code-signed, macOS Gatekeeper / Windows SmartScreen may
38
- > warn on first run (on macOS, right-click the file → **Open**). Signing is on the way.
46
+ > These binaries aren't notarized yet, so macOS/Windows may warn on first run.
47
+ > The curl installer above sidesteps the macOS prompt entirely.
39
48
  >
40
- > **Intel Mac?** There's no x64 binary yet — use **Option B** (`npx @chatpanel/bridge`).
49
+ > **Intel Mac?** No x64 binary yet — use **Option B** (`npx @chatpanel/bridge`).
41
50
  > Apple Silicon (`uname -m` → `arm64`) uses `chatpanel-bridge-macos-arm64`.
42
51
 
43
52
  ### Option B — via npm (needs Node.js 18+)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/bridge",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
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": [
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+ # ChatPanel Bridge installer — downloads the standalone binary for your OS and
3
+ # sets it to start at login. No Node.js required.
4
+ #
5
+ # curl -fsSL https://raw.githubusercontent.com/chatpanel/chatpanel-bridge/main/scripts/install.sh | bash
6
+ #
7
+ # Downloading via curl means the file is NOT quarantined, so macOS won't show the
8
+ # "damaged / unidentified developer" prompt that browser downloads trigger.
9
+ set -euo pipefail
10
+
11
+ REPO="chatpanel/chatpanel-bridge"
12
+ os="$(uname -s)"
13
+ arch="$(uname -m)"
14
+
15
+ case "$os" in
16
+ Darwin)
17
+ if [ "$arch" = "arm64" ]; then asset="chatpanel-bridge-macos-arm64"
18
+ else
19
+ echo "Intel Mac detected — no x64 binary yet. Use: npx @chatpanel/bridge (needs Node.js 18+)"
20
+ exit 1
21
+ fi ;;
22
+ Linux) asset="chatpanel-bridge-linux-x64" ;;
23
+ *)
24
+ echo "Unsupported OS ($os). Use: npx @chatpanel/bridge (needs Node.js 18+)"
25
+ exit 1 ;;
26
+ esac
27
+
28
+ url="https://github.com/$REPO/releases/latest/download/$asset"
29
+ dest="$HOME/.local/bin"
30
+ bin="$dest/chatpanel-bridge"
31
+ mkdir -p "$dest"
32
+
33
+ echo "↓ Downloading $asset…"
34
+ curl -fsSL "$url" -o "$bin"
35
+ chmod +x "$bin"
36
+ xattr -c "$bin" 2>/dev/null || true # belt-and-suspenders; curl files aren't quarantined
37
+
38
+ echo "✓ Installed to $bin"
39
+ "$bin" --install
40
+ echo
41
+ echo "ChatPanel Bridge is running and will start at login."
42
+ case ":$PATH:" in
43
+ *":$dest:"*) : ;;
44
+ *) echo "Tip: add it to your PATH → export PATH=\"\$HOME/.local/bin:\$PATH\"" ;;
45
+ esac
@@ -58,12 +58,16 @@ function ensureIsolatedHome() {
58
58
  return ISO_HOME;
59
59
  }
60
60
 
61
- let installed = null;
61
+ let installed = false;
62
+ let lastProbe = 0;
62
63
  export async function available() {
63
- if (installed === null) {
64
+ // Cache a positive result, but keep re-probing (throttled) while not found, so
65
+ // it self-heals once codex appears on PATH — never cache a negative forever.
66
+ if (!installed && Date.now() - lastProbe > 4000) {
67
+ lastProbe = Date.now();
64
68
  try {
65
- const r = spawnSync('codex', ['--version'], { stdio: 'ignore', timeout: 5000 });
66
- installed = r.status === 0 || (r.status === null && r.error === undefined);
69
+ const r = spawnSync('codex', ['--version'], { stdio: 'ignore', timeout: 8000 });
70
+ installed = r.status === 0 || (r.status === null && !r.error);
67
71
  } catch {
68
72
  installed = false;
69
73
  }
@@ -16,12 +16,16 @@ import path from 'node:path';
16
16
  const TIMEOUT_MS = Number(process.env.CHATPANEL_GEMINI_TIMEOUT_MS) || 180_000;
17
17
  const SCRATCH = path.join(os.tmpdir(), 'chatpanel-gemini-scratch');
18
18
 
19
- let installed = null;
19
+ let installed = false;
20
+ let lastProbe = 0;
20
21
  export async function available() {
21
- if (installed === null) {
22
+ // Cache a positive result, but keep re-probing (throttled) while not found, so
23
+ // it self-heals once gemini appears on PATH — never cache a negative forever.
24
+ if (!installed && Date.now() - lastProbe > 4000) {
25
+ lastProbe = Date.now();
22
26
  try {
23
- const r = spawnSync('gemini', ['--version'], { stdio: 'ignore', timeout: 5000 });
24
- installed = r.status === 0 || (r.status === null && r.error === undefined);
27
+ const r = spawnSync('gemini', ['--version'], { stdio: 'ignore', timeout: 8000 });
28
+ installed = r.status === 0 || (r.status === null && !r.error);
25
29
  } catch {
26
30
  installed = false;
27
31
  }
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.4';
24
+ const VERSION = '0.2.6';
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