@chatpanel/bridge 0.10.39 → 0.10.40
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.40",
|
|
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": [
|
|
@@ -50,7 +50,9 @@ let lastProbe = 0;
|
|
|
50
50
|
export async function available() {
|
|
51
51
|
// Cache a positive result; keep re-probing (throttled) while not found so it
|
|
52
52
|
// self-heals once agy appears on PATH — never cache a negative forever.
|
|
53
|
-
|
|
53
|
+
// Re-probe in both directions (see codex.js): an uninstalled CLI must stop reporting itself
|
|
54
|
+
// available without waiting for a bridge restart.
|
|
55
|
+
if (Date.now() - lastProbe > (installed ? 30_000 : 4000)) {
|
|
54
56
|
lastProbe = Date.now();
|
|
55
57
|
try {
|
|
56
58
|
installed = !!findAgentBin('agy');
|
package/src/engines/claude.js
CHANGED
|
@@ -54,7 +54,9 @@ let cachedOk = false;
|
|
|
54
54
|
export async function available() {
|
|
55
55
|
// Availability = "can we launch claude somehow" (native / cli.js / WSL / SDK),
|
|
56
56
|
// NOT "does `claude --version` exit 0" (which fails when it just needs login).
|
|
57
|
-
|
|
57
|
+
// Re-probe in both directions (see codex.js): caching success forever meant an uninstalled
|
|
58
|
+
// CLI still reported itself available.
|
|
59
|
+
if (Date.now() - lastProbe > (cachedOk ? 30_000 : 4000)) {
|
|
58
60
|
lastProbe = Date.now();
|
|
59
61
|
try {
|
|
60
62
|
const spec = resolveClaude();
|
|
@@ -21,9 +21,13 @@ function makeCliAgent(command, spec, notFoundHint, overrides = {}) {
|
|
|
21
21
|
return {
|
|
22
22
|
spec: resolvedSpec,
|
|
23
23
|
async available() {
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
|
|
24
|
+
// Re-probe in BOTH directions. Caching a positive result forever meant an UNINSTALLED
|
|
25
|
+
// CLI kept reporting itself available until the bridge restarted — the picker showed a
|
|
26
|
+
// green dot for an agent that could no longer run, and the turn failed with "couldn't
|
|
27
|
+
// find it on your PATH". A found CLI is re-checked on a slow interval (it rarely
|
|
28
|
+
// disappears, and `which` is cheap but not free); a missing one keeps the fast interval
|
|
29
|
+
// so it still self-heals the moment it is installed.
|
|
30
|
+
if (Date.now() - lastProbe > (installed ? 30_000 : 4000)) {
|
|
27
31
|
lastProbe = Date.now();
|
|
28
32
|
try {
|
|
29
33
|
installed = !!findAgentBin(command);
|
package/src/engines/codex.js
CHANGED
|
@@ -77,10 +77,10 @@ function ensureIsolatedHome() {
|
|
|
77
77
|
let installed = false;
|
|
78
78
|
let lastProbe = 0;
|
|
79
79
|
export async function available() {
|
|
80
|
-
// Availability = "is codex findable on PATH", not "does `codex --version` exit
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
if (
|
|
80
|
+
// Availability = "is codex findable on PATH", not "does `codex --version` exit 0" (which
|
|
81
|
+
// fails when the CLI just needs login). Re-probed in BOTH directions: caching a positive
|
|
82
|
+
// forever kept an uninstalled CLI reporting itself available until the bridge restarted.
|
|
83
|
+
if (Date.now() - lastProbe > (installed ? 30_000 : 4000)) {
|
|
84
84
|
lastProbe = Date.now();
|
|
85
85
|
try {
|
|
86
86
|
installed = !!findAgentBin('codex');
|
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.40';
|
|
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
|
|