arena-bridge 0.7.0 → 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 +13 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/audit.mjs +25 -1
- package/src/direct.mjs +1 -1
- package/src/hub.mjs +1 -1
- package/src/mcp.mjs +1 -1
- package/src/telegram.mjs +2 -2
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.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
|
+
|
|
14
|
+
## 0.7.1
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- The Telegram listener no longer gives up on a long poll when the network is slow: the request
|
|
18
|
+
ceiling is now generous enough for the 20-second long poll to answer.
|
|
19
|
+
|
|
7
20
|
## 0.7.0
|
|
8
21
|
|
|
9
22
|
### Added
|
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-
|
|
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.
|
|
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
package/src/hub.mjs
CHANGED
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.
|
|
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.',
|
package/src/telegram.mjs
CHANGED
|
@@ -78,7 +78,7 @@ export async function apiCall(cfg, method, payload = {}) {
|
|
|
78
78
|
method: 'POST',
|
|
79
79
|
headers: { 'Content-Type': 'application/json' },
|
|
80
80
|
body: JSON.stringify(payload),
|
|
81
|
-
signal: AbortSignal.timeout(
|
|
81
|
+
signal: AbortSignal.timeout(90_000),
|
|
82
82
|
});
|
|
83
83
|
data = await res.json().catch(() => null);
|
|
84
84
|
} catch (e) {
|
|
@@ -281,7 +281,7 @@ export function startPoller(cfg, { onMessage } = {}) {
|
|
|
281
281
|
try {
|
|
282
282
|
const res = await apiCall(fresh(), 'getUpdates', {
|
|
283
283
|
offset,
|
|
284
|
-
timeout:
|
|
284
|
+
timeout: 20,
|
|
285
285
|
allowed_updates: ['message'],
|
|
286
286
|
});
|
|
287
287
|
if (!res.ok) {
|