arena-bridge 0.7.16 → 0.7.17

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,14 @@ 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.17
8
+
9
+ ### Fixed
10
+ - The permission list of macOS shows the name of the app and not `node`. The background service now
11
+ starts through a small helper inside the signed app bundle, so macOS gives the screen and the
12
+ accessibility permissions to «Arena Bridge». Without the app the service starts the old way, so the
13
+ command line only installation keeps working.
14
+
7
15
  ## 0.7.16
8
16
 
9
17
  ### Fixed
package/README.md CHANGED
@@ -320,10 +320,14 @@ Apple Silicon. Готовые сборки для обеих архитекту
320
320
  ### Разрешения macOS
321
321
 
322
322
  Мосту нужны два разрешения: «Запись экрана» (снимки) и «Управление доступностью» (дерево
323
- элементов). В списке «Запись экрана» они выглядят как `node` и `daemon-*.sock` — так macOS
324
- показывает программы без своего значка. Строку `node` можно удалить кнопкой «−», но вернётся
325
- она, когда Peekaboo снова попросит экран: он написан на node. Служба моста запускается из
326
- постоянных папок (`~/.local/share/fnm/node-versions/...`), а не из временной папки версии
323
+ элементов). macOS записывает разрешение на того, кто запросил его сверху, поэтому служба моста
324
+ стартует через маленький помощник внутри подписанного бандла приложения
325
+ (`Arena Bridge.app/Contents/Helpers/arena-bridge-agent`). В списке «Запись экрана» такая строка
326
+ называется как приложение — «Arena Bridge», а не `node`.
327
+
328
+ Строку `node`, если она осталась от прежней установки, можно удалить кнопкой «−»: новая запись
329
+ придёт под именем приложения, и её нужно один раз включить в настройках. Служба моста запускается
330
+ из постоянных папок (`~/.local/share/fnm/node-versions/...`), а не из временной папки версии
327
331
  менеджера, поэтому разрешение само по себе не слетает.
328
332
 
329
333
  ### Как переименовать
@@ -332,12 +336,13 @@ Apple Silicon. Готовые сборки для обеих архитекту
332
336
 
333
337
  | Файл | Что там |
334
338
  | --- | --- |
335
- | `src/app.mjs` | `APP_NAME`, `APP_ID`, `SERVICE_LABEL` — для командной строки |
339
+ | `src/app.mjs` | `APP_NAME`, `APP_ID`, `SERVICE_LABEL`, `AGENT_NAME` — для командной строки |
336
340
  | `arena_bridge/app.py` | то же самое для Python |
337
341
  | `macos/ArenaBridge/Sources/AppInfo.swift` | то же самое для приложения; `build.sh` берёт имя отсюда |
338
342
 
339
343
  Фоновая служба в «Системных настройках → Вход» называется так же, как приложение, а не
340
- «node» или «python»: запускает её небольшой скрипт `~/.arena-bridge/Arena Bridge`.
344
+ «node» или «python»: запускает её помощник внутри бандла приложения, а без приложения — небольшой
345
+ скрипт `~/.arena-bridge/Arena Bridge`.
341
346
 
342
347
  ---
343
348
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.7.16",
3
+ "version": "0.7.17",
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/app.mjs CHANGED
@@ -6,3 +6,6 @@ export const APP_ID = 'com.arenabridge.app';
6
6
 
7
7
  /** The label of the launchd service. */
8
8
  export const SERVICE_LABEL = 'ai.arena.bridge';
9
+
10
+ /** The helper inside the app bundle that starts the bridge. */
11
+ export const AGENT_NAME = 'arena-bridge-agent';
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.16',
76
+ version: '0.7.17',
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.16',
93
+ version: '0.7.17',
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.16' },
51
+ serverInfo: { name: 'arena-bridge', version: '0.7.17' },
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
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import { execFileSync } from 'node:child_process';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { CONFIG_DIR, ensureDirs } from './config.mjs';
7
- import { APP_NAME, SERVICE_LABEL as LABEL } from './app.mjs';
7
+ import { APP_NAME, SERVICE_LABEL as LABEL, AGENT_NAME } from './app.mjs';
8
8
 
9
9
  export function plistPath() {
10
10
  return path.join(os.homedir(), 'Library', 'LaunchAgents', `${LABEL}.plist`);
@@ -18,6 +18,35 @@ export function runnerPath() {
18
18
  return path.join(CONFIG_DIR, APP_NAME);
19
19
  }
20
20
 
21
+ /**
22
+ * The app bundle that holds the helper. It gives the screen and the accessibility
23
+ * permissions to the app and not to the node binary.
24
+ */
25
+ export function appBundlePath() {
26
+ const explicit = process.env.ARENA_BRIDGE_APP;
27
+ const candidates = explicit
28
+ ? [explicit]
29
+ : [
30
+ path.join('/Applications', `${APP_NAME}.app`),
31
+ path.join(os.homedir(), 'Applications', `${APP_NAME}.app`),
32
+ ];
33
+ for (const candidate of candidates) {
34
+ if (candidate && fs.existsSync(path.join(candidate, 'Contents', 'Info.plist'))) return candidate;
35
+ }
36
+ return null;
37
+ }
38
+
39
+ /**
40
+ * The helper inside the bundle starts the bridge. macOS gives the permissions to the
41
+ * app that starts the request, so the system settings show the name of the app.
42
+ */
43
+ export function agentPath() {
44
+ const bundle = appBundlePath();
45
+ if (!bundle) return null;
46
+ const helper = path.join(bundle, 'Contents', 'Helpers', AGENT_NAME);
47
+ return fs.existsSync(helper) ? helper : null;
48
+ }
49
+
21
50
  /**
22
51
  * The node of the version manager lives in a folder that every new shell creates and that is
23
52
  * deleted afterwards. macOS binds a permission to the exact file, so a service that starts from
@@ -67,13 +96,25 @@ exec "${stableNode()}" "${cliEntry()}" "$@"
67
96
  `;
68
97
  }
69
98
 
70
- export function plistXml({ bin, domain, authtoken, port } = {}) {
71
- const logs = logDir();
99
+ /**
100
+ * The command the service starts. The helper inside the app bundle gives the screen and the
101
+ * accessibility permissions to the app, so the system settings show its name. Without the app
102
+ * the service starts the wrapper script.
103
+ */
104
+ export function programArguments({ bin, domain, authtoken, port } = {}) {
72
105
  const extra = [];
73
106
  if (bin) extra.push('--bin', String(bin));
74
107
  if (domain) extra.push('--domain', String(domain));
75
108
  if (authtoken) extra.push('--authtoken', String(authtoken));
76
109
  if (port) extra.push('--port', String(port));
110
+ const helper = agentPath();
111
+ if (helper) return [helper, stableNode(), cliEntry(), 'tunnel', ...extra];
112
+ return [runnerPath(), 'tunnel', ...extra];
113
+ }
114
+
115
+ export function plistXml(options = {}) {
116
+ const logs = logDir();
117
+ const program = programArguments(options);
77
118
  return `<?xml version="1.0" encoding="UTF-8"?>
78
119
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
79
120
  <plist version="1.0">
@@ -81,9 +122,7 @@ export function plistXml({ bin, domain, authtoken, port } = {}) {
81
122
  <key>Label</key><string>${LABEL}</string>
82
123
  <key>ProgramArguments</key>
83
124
  <array>
84
- <string>${runnerPath()}</string>
85
- <string>tunnel</string>
86
- ${extra.map((a) => ` <string>${a}</string>`).join('\n')}
125
+ ${program.map((a) => ` <string>${a}</string>`).join('\n')}
87
126
  </array>
88
127
  <key>RunAtLoad</key><true/>
89
128
  <key>KeepAlive</key><true/>