arena-bridge 0.7.1 → 0.7.2

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,13 @@ 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.7.2
8
+
9
+ ### Fixed
10
+ - The audit log masks credentials: a Telegram bot token, a GitHub, npm or PyPI token in a
11
+ command or an argument is written as `***`, so the log cannot become a secret store the
12
+ agent may read.
13
+
7
14
  ## 0.7.1
8
15
 
9
16
  ### Fixed
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  <img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="license">
13
13
  <img src="https://img.shields.io/badge/node-%3E%3D18-green.svg?style=flat-square" alt="node">
14
14
  <img src="https://img.shields.io/badge/dependencies-0-brightgreen.svg?style=flat-square" alt="dependencies">
15
- <img src="https://img.shields.io/badge/tests-147%20passed-brightgreen.svg?style=flat-square" alt="tests">
15
+ <img src="https://img.shields.io/badge/tests-149%20passed-brightgreen.svg?style=flat-square" alt="tests">
16
16
  </p>
17
17
 
18
18
  <p align="center">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
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/audit.mjs CHANGED
@@ -11,11 +11,35 @@ export function auditPath() {
11
11
  return path.join(configDir(), 'audit.log');
12
12
  }
13
13
 
14
+ const SECRETS = [
15
+ /(?<!\d)\d{6,12}:[A-Za-z0-9_-]{25,}/g, // telegram bot tokens
16
+ /\bgh[pousr]_[A-Za-z0-9]{20,}\b/g, // github tokens
17
+ /\bnpm_[A-Za-z0-9]{20,}\b/g, // npm tokens
18
+ /\bpypi-[A-Za-z0-9_-]{20,}\b/g, // pypi tokens
19
+ /\bsk-[A-Za-z0-9]{20,}\b/g, // api keys
20
+ ];
21
+
22
+ /** Mask anything that looks like a credential, so the log never becomes a secret store. */
23
+ export function scrub(value) {
24
+ if (typeof value === 'string') {
25
+ let out = value;
26
+ for (const re of SECRETS) out = out.replace(re, '***');
27
+ return out;
28
+ }
29
+ if (Array.isArray(value)) return value.map(scrub);
30
+ if (value && typeof value === 'object') {
31
+ const out = {};
32
+ for (const [k, v] of Object.entries(value)) out[k] = scrub(v);
33
+ return out;
34
+ }
35
+ return value;
36
+ }
37
+
14
38
  export function audit(entry) {
15
39
  try {
16
40
  const dir = configDir();
17
41
  fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
18
- const rec = { ts: new Date().toISOString(), ...entry };
42
+ const rec = { ts: new Date().toISOString(), ...scrub(entry) };
19
43
  fs.appendFileSync(auditPath(), JSON.stringify(rec) + '\n', { mode: 0o600 });
20
44
  } catch {
21
45
  /* auditing must never break the request */
package/src/direct.mjs CHANGED
@@ -52,7 +52,7 @@ export function createDirectServer(cfg, engine) {
52
52
  ok: true,
53
53
  mode: 'direct',
54
54
  device: cfg.device,
55
- version: '0.7.1',
55
+ version: '0.7.2',
56
56
  uptime_sec: Math.round(process.uptime()),
57
57
  });
58
58
  }
package/src/hub.mjs CHANGED
@@ -90,7 +90,7 @@ export function createHubServer(cfg) {
90
90
  return sendJson(res, 200, {
91
91
  ok: true,
92
92
  mode: 'hub',
93
- version: '0.7.1',
93
+ version: '0.7.2',
94
94
  devices: [...devices.keys()],
95
95
  });
96
96
  }
package/src/mcp.mjs CHANGED
@@ -48,7 +48,7 @@ export async function handleMcp(req, res, ctx) {
48
48
  mcpResponse(id, {
49
49
  protocolVersion: PROTOCOL_VERSION,
50
50
  capabilities: { tools: { listChanged: false } },
51
- serverInfo: { name: 'arena-bridge', version: '0.7.1' },
51
+ serverInfo: { name: 'arena-bridge', version: '0.7.2' },
52
52
  instructions:
53
53
  'Tools operate the user\'s own machine. Dangerous operations may return ' +
54
54
  'PROTECTED and require a local human approval.',