arena-bridge 0.20.5 → 0.20.7

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/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to this project are documented here.
4
4
  The format follows [Keep a Changelog](https://keepachangelog.com/) and the project uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## 0.20.7
8
+
9
+ ### Fixed
10
+ - The macOS start check allows the full tunnel retry window; a recovered live tunnel clears a stale startup failure.
11
+ - The app no longer presents a saved public URL as live when the local health endpoint reports that the tunnel is down.
12
+ - ngrok stdout/stderr is retained in bounded tunnel diagnostics and the audit log; configured authtokens are redacted.
13
+
14
+ ## 0.20.6
15
+
16
+ ### Fixed
17
+ - Prevented the menubar status item from continuously redrawing during start and stop transitions.
18
+ - Moved service-state and CLI process checks off the main UI thread and bounded CLI execution time.
19
+
7
20
  ## 0.20.5
8
21
 
9
22
  ### Fixed
package/README.md CHANGED
@@ -147,6 +147,8 @@ arena-bridge setup --root ~/projects
147
147
 
148
148
  ## Управление Chrome
149
149
 
150
+ Для уже запущенного Chrome с несколькими профилями см. [подключение через DevToolsActivePort](docs/chrome-existing-session-cdp.md): один browser-level CDP-сеанс, выбор вкладки по URL/title и обязательная активация перед действиями. Это отдельный проверенный ручной сценарий; текущий `chrome_attach` пока использует `/json/version`.
151
+
150
152
  Свой минимальный CDP-клиент внутри пакета: **ни puppeteer, ни playwright не нужны**.
151
153
 
152
154
  ```jsonc
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.20.5",
3
+ "version": "0.20.7",
4
4
  "description": "Give a cloud AI agent (Arena.ai Agent Mode, Claude, Cursor, ...) controlled access to your own machine over HTTP/MCP: files, shell, Chrome and the macOS desktop, with an approval gate, trust windows and an audit log.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.mjs CHANGED
@@ -383,7 +383,14 @@ async function cmdTunnel(args) {
383
383
  bin,
384
384
  authtoken,
385
385
  domain,
386
- onExit: (code) => tunnelEvent('down', { code }),
386
+ onExit: (code, details = {}) => {
387
+ const output = typeof details.output === 'string' ? details.output.slice(-1800) : '';
388
+ tunnelEvent('down', { code, attempt: details.attempt, ...(output ? { output } : {}) });
389
+ if (typeof code === 'number' && code !== 0 && output) {
390
+ console.error(`[tunnel] ${bin} exited with code ${code} (attempt ${details.attempt || '?'})`);
391
+ console.error(output);
392
+ }
393
+ },
387
394
  });
388
395
  const { urlPromise, onUrl } = tunnel;
389
396
 
package/src/tunnel.mjs CHANGED
@@ -68,6 +68,16 @@ export function killTunnelsForPort(port) {
68
68
  const URL_RE = /https:\/\/[a-z0-9-]+\.trycloudflare\.com/i;
69
69
  const NGROK_URL_RE = /https:\/\/[a-z0-9-]+\.ngrok(?:-free)?\.(?:app|io|dev)/i;
70
70
 
71
+ function redactTunnelOutput(value, authtoken) {
72
+ let text = String(value)
73
+ .replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, '')
74
+ .replace(/\u0000/g, '');
75
+ if (authtoken) text = text.split(String(authtoken)).join('[REDACTED]');
76
+ return text
77
+ .replace(/(--authtoken(?:=|\s+))\S+/gi, '$1[REDACTED]')
78
+ .replace(/(authtoken["']?\s*[:=]\s*["']?)[^"'\s,}]+/gi, '$1[REDACTED]');
79
+ }
80
+
71
81
  /**
72
82
  * Starts a tunnel and resolves with the public URL it prints.
73
83
  * cloudflared: QUIC (UDP/7844) is blocked on many networks, so we default to http2 over TCP/443.
@@ -127,6 +137,7 @@ export function startTunnel(
127
137
 
128
138
  let child = null;
129
139
  let buffer = '';
140
+ let diagnosticTail = '';
130
141
  let settled = false;
131
142
  let attempt = 0;
132
143
  let exhausted = false;
@@ -140,8 +151,15 @@ export function startTunnel(
140
151
  });
141
152
 
142
153
  const onChunk = (chunk) => {
143
- buffer += chunk.toString();
144
- const match = urlPattern.exec(buffer);
154
+ const text = chunk.toString()
155
+ .replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, '')
156
+ .replace(/\u0000/g, '');
157
+ const combined = buffer + text;
158
+ const match = urlPattern.exec(combined);
159
+ buffer = combined.slice(-8192);
160
+ // Keep the raw bounded tail until chunks have been reassembled. Redaction on
161
+ // individual chunks can miss a credential split across two stream events.
162
+ diagnosticTail = (diagnosticTail + text).slice(-4000);
145
163
  if (!match) return;
146
164
  if (!settled) {
147
165
  settled = true;
@@ -163,7 +181,8 @@ export function startTunnel(
163
181
  }
164
182
  });
165
183
  child.on('close', (code) => {
166
- onExit?.(code);
184
+ const output = redactTunnelOutput(diagnosticTail.trim(), authtoken).slice(-2000);
185
+ onExit?.(code, { attempt: attempt + 1, output });
167
186
  const mine = child;
168
187
  if (!settled) {
169
188
  if (!exhausted && isNgrok && attempt++ < restarts) {
@@ -172,7 +191,9 @@ export function startTunnel(
172
191
  return;
173
192
  }
174
193
  settled = true;
175
- rejectUrl(new Error(`${bin} exited with code ${code} before the tunnel URL appeared`));
194
+ const details = redactTunnelOutput(diagnosticTail.trim(), authtoken);
195
+ const suffix = details ? `\nLast output from ${bin}:\n${details}` : '';
196
+ rejectUrl(new Error(`${bin} exited with code ${code} before the tunnel URL appeared${suffix}`));
176
197
  return;
177
198
  }
178
199
  if (!exhausted && attempt++ < restarts) {
package/src/version.mjs CHANGED
@@ -3,7 +3,7 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
 
6
- export const VERSION = "0.20.5";
6
+ export const VERSION = "0.20.7";
7
7
 
8
8
  export function getVersion() {
9
9
  try {