arena-bridge 0.6.6 → 0.6.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 CHANGED
@@ -4,6 +4,12 @@ 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.6.7
8
+
9
+ ### Added
10
+ - `arena-bridge service install --bin ngrok --domain <name>` installs the macOS background
11
+ service with a fixed public address; `arena-bridge service status` now shows the current URL.
12
+
7
13
  ## 0.6.6
8
14
 
9
15
  ### 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-114%20passed-brightgreen.svg?style=flat-square" alt="tests">
15
+ <img src="https://img.shields.io/badge/tests-115%20passed-brightgreen.svg?style=flat-square" alt="tests">
16
16
  </p>
17
17
 
18
18
  <p align="center">
@@ -64,6 +64,18 @@ arena-bridge setup --root ~/projects --root ~/Documents
64
64
 
65
65
  ### В фоне, чтобы не открывать терминал
66
66
 
67
+ Мост можно поднять как службу macOS — он стартует вместе с системой, переживает закрытие
68
+ терминала и поднимается заново после сбоя:
69
+
70
+ ```bash
71
+ arena-bridge service install # облако, случайный адрес
72
+ arena-bridge service install --bin ngrok --domain mymac.ngrok-free.app # постоянный адрес
73
+ arena-bridge service status # состояние и текущий URL
74
+ arena-bridge url # текущий публичный адрес
75
+ arena-bridge service uninstall
76
+ ```
77
+
78
+
67
79
  ```bash
68
80
  arena-bridge service install # launchd: стартует вместе с системой, URL всегда живой
69
81
  arena-bridge url # текущий публичный URL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.6.6",
3
+ "version": "0.6.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/cli.mjs CHANGED
@@ -440,7 +440,12 @@ async function cmdUpdate(args) {
440
440
  function cmdService(args) {
441
441
  const what = args._[1] || 'status';
442
442
  if (what === 'install') {
443
- const res = serviceInstall();
443
+ const res = serviceInstall({
444
+ bin: args.flags.bin,
445
+ domain: args.flags.domain,
446
+ authtoken: args.flags.authtoken,
447
+ port: args.flags.port,
448
+ });
444
449
  console.log(`\u2713 service installed: ${res.plist}`);
445
450
  console.log(' the bridge now starts with the system and keeps a public URL alive');
446
451
  console.log(' current URL: arena-bridge url');
@@ -454,6 +459,8 @@ function cmdService(args) {
454
459
  const st = serviceStatus();
455
460
  console.log(`service: ${st.installed ? 'installed' : 'not installed'} (${st.running ? 'running' : 'not running'})`);
456
461
  console.log(` plist: ${st.plist}`);
462
+ const current = loadConfig().publicUrl;
463
+ if (current) console.log(` current URL: ${current}`);
457
464
  if (st.detail) console.log(` ${st.detail.split('\n')[0]}`);
458
465
  if (!st.installed) console.log(' install it with: arena-bridge service install');
459
466
  }
package/src/direct.mjs CHANGED
@@ -29,7 +29,7 @@ export function createDirectServer(cfg, engine) {
29
29
  ok: true,
30
30
  mode: 'direct',
31
31
  device: cfg.device,
32
- version: '0.6.6',
32
+ version: '0.6.7',
33
33
  uptime_sec: Math.round(process.uptime()),
34
34
  });
35
35
  }
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.6.6',
93
+ version: '0.6.7',
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.6.6' },
51
+ serverInfo: { name: 'arena-bridge', version: '0.6.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/service.mjs CHANGED
@@ -21,9 +21,14 @@ function cliEntry() {
21
21
  return path.join(here, '..', 'bin', 'arena-bridge.mjs');
22
22
  }
23
23
 
24
- function plistXml() {
24
+ function plistXml({ bin, domain, authtoken, port } = {}) {
25
25
  const cli = cliEntry();
26
26
  const logs = logDir();
27
+ const extra = [];
28
+ if (bin) extra.push('--bin', String(bin));
29
+ if (domain) extra.push('--domain', String(domain));
30
+ if (authtoken) extra.push('--authtoken', String(authtoken));
31
+ if (port) extra.push('--port', String(port));
27
32
  return `<?xml version="1.0" encoding="UTF-8"?>
28
33
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
29
34
  <plist version="1.0">
@@ -34,6 +39,7 @@ function plistXml() {
34
39
  <string>${process.execPath}</string>
35
40
  <string>${cli}</string>
36
41
  <string>tunnel</string>
42
+ ${extra.map((a) => ` <string>${a}</string>`).join('\n')}
37
43
  </array>
38
44
  <key>RunAtLoad</key><true/>
39
45
  <key>KeepAlive</key><true/>
@@ -63,12 +69,12 @@ export function serviceStatus() {
63
69
  return { installed, running, plist: plistPath(), detail: out.trim().slice(0, 600) };
64
70
  }
65
71
 
66
- export function serviceInstall() {
72
+ export function serviceInstall(options = {}) {
67
73
  ensureDirs();
68
74
  fs.mkdirSync(logDir(), { recursive: true });
69
75
  const dir = path.dirname(plistPath());
70
76
  fs.mkdirSync(dir, { recursive: true });
71
- fs.writeFileSync(plistPath(), plistXml());
77
+ fs.writeFileSync(plistPath(), plistXml(options));
72
78
  launchctl(['bootout', `gui/${process.getuid()}/${LABEL}`], { quiet: true });
73
79
  const out = launchctl(['bootstrap', `gui/${process.getuid()}`, plistPath()], { quiet: true });
74
80
  launchctl(['enable', `gui/${process.getuid()}/${LABEL}`], { quiet: true });