arena-bridge 0.5.1 → 0.5.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 +7 -0
- 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/selfupdate.mjs +33 -1
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.5.2
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- `arena-bridge update` now replaces the very installation it runs from (the npm prefix is
|
|
11
|
+
detected), survives a tarball install that left a conflicting link, and retries when the
|
|
12
|
+
registry metadata is ahead of the tarball.
|
|
13
|
+
|
|
7
14
|
## 0.5.1
|
|
8
15
|
|
|
9
16
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arena-bridge",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.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/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.5.
|
|
51
|
+
serverInfo: { name: 'arena-bridge', version: '0.5.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/selfupdate.mjs
CHANGED
|
@@ -6,6 +6,21 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
7
|
const PKG = 'arena-bridge';
|
|
8
8
|
|
|
9
|
+
/** The npm prefix the current installation lives in, so an update replaces this very copy. */
|
|
10
|
+
export function installPrefix() {
|
|
11
|
+
try {
|
|
12
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const parts = here.split(path.sep);
|
|
14
|
+
const idx = parts.lastIndexOf('node_modules');
|
|
15
|
+
if (idx < 1) return null;
|
|
16
|
+
let prefix = parts.slice(0, idx).join(path.sep);
|
|
17
|
+
if (prefix.endsWith(`${path.sep}lib`)) prefix = prefix.slice(0, -4);
|
|
18
|
+
return prefix || null;
|
|
19
|
+
} catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
9
24
|
export function packageInfo() {
|
|
10
25
|
try {
|
|
11
26
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -65,7 +80,24 @@ export async function selfUpdate({ dryRun = false } = {}) {
|
|
|
65
80
|
if (dryRun) {
|
|
66
81
|
return { ok: true, upToDate: false, installed: info.version, latest, command: `npm i -g ${PKG}@latest` };
|
|
67
82
|
}
|
|
68
|
-
const
|
|
83
|
+
const prefix = installPrefix();
|
|
84
|
+
const install = (extra = []) =>
|
|
85
|
+
run('npm', ['i', '-g', ...(prefix ? ['--prefix', prefix] : []), ...extra, `${PKG}@${latest}`]);
|
|
86
|
+
|
|
87
|
+
let res = await run('npm', ['i', '-g', ...(prefix ? ['--prefix', prefix] : []), `${PKG}@latest`]);
|
|
88
|
+
if (!res.ok && /notarget|ETARGET|No matching version/i.test(res.stderr || '')) {
|
|
89
|
+
// the registry metadata can be ahead of the tarball for a moment after a publish
|
|
90
|
+
await new Promise((r) => setTimeout(r, 15000));
|
|
91
|
+
res = await install();
|
|
92
|
+
}
|
|
93
|
+
if (!res.ok && /EEXIST|already exists/i.test(res.stderr || '')) {
|
|
94
|
+
// a previous install from a tarball leaves a conflicting link in the global bin
|
|
95
|
+
res = await run('npm', ['i', '-g', ...(prefix ? ['--prefix', prefix] : []), '--force', `${PKG}@${latest}`]);
|
|
96
|
+
if (!res.ok) {
|
|
97
|
+
await run('npm', ['rm', '-g', ...(prefix ? ['--prefix', prefix] : []), PKG]);
|
|
98
|
+
res = await install();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
69
101
|
if (!res.ok) {
|
|
70
102
|
return {
|
|
71
103
|
ok: false,
|