@chatpanel/bridge 0.11.0 → 0.11.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +14 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatpanel/bridge",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
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": [
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.11.0';
70
+ const VERSION = '0.11.1';
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
 
@@ -337,8 +337,19 @@ const PRIVILEGED_POST = new Set([
337
337
  '/channels/settings',
338
338
  '/channels/disconnect',
339
339
  ]);
340
- // /channels lists which phones may drive this machine. That is not a public reading.
341
- const PRIVILEGED_GET = new Set(['/debug', '/channels']);
340
+ // /channels is NOT here, for the same reason /skills is not, and it was a regression to add
341
+ // it: a privileged GET is unreachable from the extension. The panel holds `<all_urls>`, so
342
+ // its fetches bypass CORS altogether — no preflight fires — and the Fetch spec attaches
343
+ // `Origin` only to requests whose method is not GET or HEAD. That is the whole asymmetry:
344
+ // every privileged POST here works, and a privileged GET can only ever answer the settings
345
+ // page with "forbidden: this endpoint requires the ChatPanel extension or a valid bridge
346
+ // token", which is what shipped in 0.11.0.
347
+ //
348
+ // Nothing is opened up by removing it. `originAllowed` still refuses any web page (it is the
349
+ // check doing the work), so the only caller admitted is a local no-Origin process — which can
350
+ // already read ~/.chatpanel/channels/ off the disk. /debug stays privileged: it exposes
351
+ // configuration a local process cannot otherwise see.
352
+ const PRIVILEGED_GET = new Set(['/debug']);
342
353
 
343
354
  // /skills* is NOT privileged, and that is a considered position rather than a
344
355
  // convenience. `privileged` adds exactly one thing over the origin allowlist: it requires