@chatpanel/bridge 0.2.5 → 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/package.json +1 -1
- package/src/engines/codex.js +8 -4
- package/src/engines/gemini.js +8 -4
- package/src/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/bridge",
|
|
3
|
-
"version": "0.2.
|
|
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": [
|
package/src/engines/codex.js
CHANGED
|
@@ -58,12 +58,16 @@ function ensureIsolatedHome() {
|
|
|
58
58
|
return ISO_HOME;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
let installed =
|
|
61
|
+
let installed = false;
|
|
62
|
+
let lastProbe = 0;
|
|
62
63
|
export async function available() {
|
|
63
|
-
|
|
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:
|
|
66
|
-
installed = r.status === 0 || (r.status === null && r.error
|
|
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
|
}
|
package/src/engines/gemini.js
CHANGED
|
@@ -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 =
|
|
19
|
+
let installed = false;
|
|
20
|
+
let lastProbe = 0;
|
|
20
21
|
export async function available() {
|
|
21
|
-
|
|
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:
|
|
24
|
-
installed = r.status === 0 || (r.status === null && r.error
|
|
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.
|
|
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
|
|