arena-bridge 0.7.13 → 0.7.15

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,21 @@ 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.15
8
+
9
+ ### Fixed
10
+ - The background service starts from permanent folders only. The version manager keeps node in a
11
+ folder that every new shell creates and that is deleted afterwards, and macOS binds the
12
+ permission to the exact file: the service lost the screen recording permission when that
13
+ folder disappeared. The node of the permanent installation and the folder of the user are used
14
+ now, so the permission stays.
15
+
16
+ ## 0.7.14
17
+
18
+ ### Fixed
19
+ - The tests never write to the real configuration of the machine: every test checks that the
20
+ folder it uses is a temporary one.
21
+
7
22
  ## 0.7.13
8
23
 
9
24
  ### 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-156%20passed-brightgreen.svg?style=flat-square" alt="tests">
15
+ <img src="https://img.shields.io/badge/tests-161%20passed-brightgreen.svg?style=flat-square" alt="tests">
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -317,6 +317,15 @@ Apple Silicon. Готовые сборки для обеих архитекту
317
317
  Иконка приложения лежит в `macos/ArenaBridge/Resources/AppIcon.png`; `build.sh` сам собирает
318
318
  из неё `.icns` и кладёт в бандл. Вокруг знака прозрачно — на светлом фоне иконка не белая.
319
319
 
320
+ ### Разрешения macOS
321
+
322
+ Мосту нужны два разрешения: «Запись экрана» (снимки) и «Управление доступностью» (дерево
323
+ элементов). В списке «Запись экрана» они выглядят как `node` и `daemon-*.sock` — так macOS
324
+ показывает программы без своего значка. Строку `node` можно удалить кнопкой «−», но вернётся
325
+ она, когда Peekaboo снова попросит экран: он написан на node. Служба моста запускается из
326
+ постоянных папок (`~/.local/share/fnm/node-versions/...`), а не из временной папки версии
327
+ менеджера, поэтому разрешение само по себе не слетает.
328
+
320
329
  ### Как переименовать
321
330
 
322
331
  Имя приложения лежит в трёх местах, и тесты следят, чтобы они совпадали:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.7.13",
3
+ "version": "0.7.15",
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
@@ -73,7 +73,7 @@ export function createDirectServer(cfg, engine) {
73
73
  ok: true,
74
74
  mode: 'direct',
75
75
  device: cfg.device,
76
- version: '0.7.13',
76
+ version: '0.7.15',
77
77
  uptime_sec: Math.round(process.uptime()),
78
78
  });
79
79
  }
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.13',
93
+ version: '0.7.15',
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.13' },
51
+ serverInfo: { name: 'arena-bridge', version: '0.7.15' },
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/service.mjs CHANGED
@@ -18,6 +18,38 @@ export function runnerPath() {
18
18
  return path.join(CONFIG_DIR, APP_NAME);
19
19
  }
20
20
 
21
+ /**
22
+ * The node of the version manager lives in a folder that every new shell creates and that is
23
+ * deleted afterwards. macOS binds a permission to the exact file, so a service that starts from
24
+ * such a folder loses its screen recording permission. The service always uses the permanent
25
+ * installation instead.
26
+ */
27
+ export function stableNode() {
28
+ const exec = process.execPath;
29
+ if (!exec.includes('fnm_multishells')) return exec;
30
+ const versions = path.join(os.homedir(), '.local', 'share', 'fnm', 'node-versions');
31
+ try {
32
+ const dirs = fs.readdirSync(versions)
33
+ .map((d) => path.join(versions, d))
34
+ .filter((d) => fs.existsSync(path.join(d, 'installation', 'bin', 'node')))
35
+ .sort((a, b) => fs.statSync(b).mtimeMs - fs.statSync(a).mtimeMs);
36
+ if (dirs[0]) return path.join(dirs[0], 'installation', 'bin', 'node');
37
+ } catch {
38
+ /* keep the current one */
39
+ }
40
+ return exec;
41
+ }
42
+
43
+ /** The PATH of the service: permanent folders only. */
44
+ export function servicePath() {
45
+ const parts = (process.env.PATH || '/usr/local/bin:/usr/bin:/bin')
46
+ .split(':')
47
+ .filter((p) => p && !p.includes('fnm_multishells'));
48
+ const home = path.join(os.homedir(), '.local', 'bin');
49
+ const nodeBin = path.dirname(stableNode());
50
+ return [home, nodeBin, ...parts.filter((p) => p !== home && p !== nodeBin)].join(':');
51
+ }
52
+
21
53
  export function logDir() {
22
54
  return path.join(CONFIG_DIR, 'logs');
23
55
  }
@@ -31,7 +63,7 @@ function cliEntry() {
31
63
  function runnerScript() {
32
64
  return `#!/bin/sh
33
65
  # ${APP_NAME}: the background service of the bridge.
34
- exec "${process.execPath}" "${cliEntry()}" "$@"
66
+ exec "${stableNode()}" "${cliEntry()}" "$@"
35
67
  `;
36
68
  }
37
69
 
@@ -59,7 +91,7 @@ ${extra.map((a) => ` <string>${a}</string>`).join('\n')}
59
91
  <key>StandardErrorPath</key><string>${path.join(logs, 'bridge.err.log')}</string>
60
92
  <key>EnvironmentVariables</key>
61
93
  <dict>
62
- <key>PATH</key><string>${process.env.PATH || '/usr/local/bin:/usr/bin:/bin'}</string>
94
+ <key>PATH</key><string>${servicePath()}</string>
63
95
  </dict>
64
96
  </dict>
65
97
  </plist>