arena-bridge 0.7.6 → 0.7.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 +7 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/direct.mjs +1 -1
- package/src/hub.mjs +1 -1
- package/src/mcp.mjs +1 -1
- package/src/policy.mjs +11 -2
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.7
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- The path policy compares the authorized roots the same way as the target, so a root that goes
|
|
11
|
+
through a symlink (for example the temporary folder on macOS) no longer looks "outside".
|
|
12
|
+
- The release workflow installs twine and always attaches the macOS app to the release.
|
|
13
|
+
|
|
7
14
|
## 0.7.6
|
|
8
15
|
|
|
9
16
|
### 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-156%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.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/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.7' },
|
|
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/policy.mjs
CHANGED
|
@@ -26,6 +26,15 @@ export function resolveTarget(p, base = process.cwd()) {
|
|
|
26
26
|
return path.join(real, ...tail);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/** Resolve a configured path the same way as a target, so symlinks never break the comparison. */
|
|
30
|
+
function resolveConfigured(p, base) {
|
|
31
|
+
try {
|
|
32
|
+
return resolveTarget(p, base);
|
|
33
|
+
} catch {
|
|
34
|
+
return path.resolve(String(p ?? ''));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
export function isInside(child, parent) {
|
|
30
39
|
const rel = path.relative(parent, child);
|
|
31
40
|
return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));
|
|
@@ -42,7 +51,7 @@ export function checkPath(p, cfg, base = process.cwd(), _opts = {}) {
|
|
|
42
51
|
} catch (e) {
|
|
43
52
|
return { ok: false, error: 'INVALID_PATH', reason: e.message };
|
|
44
53
|
}
|
|
45
|
-
for (const prot of cfg.protected || []) {
|
|
54
|
+
for (const prot of (cfg.protected || []).map((r) => resolveConfigured(r, base))) {
|
|
46
55
|
if (isInside(abs, prot)) {
|
|
47
56
|
return {
|
|
48
57
|
ok: false,
|
|
@@ -52,7 +61,7 @@ export function checkPath(p, cfg, base = process.cwd(), _opts = {}) {
|
|
|
52
61
|
};
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
|
-
const roots = cfg.roots || [];
|
|
64
|
+
const roots = (cfg.roots || []).map((r) => resolveConfigured(r, base));
|
|
56
65
|
if (!roots.some((r) => isInside(abs, r))) {
|
|
57
66
|
return {
|
|
58
67
|
ok: false,
|