arena-bridge 0.8.12 → 0.8.13

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.8.13
8
+
9
+ ### Added
10
+ - `src/catalog.mjs` single source for `toolCatalog()` (re-export from `engine.mjs` as phase 1), `src/gate.mjs` unified `authorize(tool,args,cfg)` (trust+gate+audit) for `POST /call` and `PUT/DELETE /files`, `src/cli/` modularity scaffold (wave 3 step 1). `docs/reference/security.md` documents `state.json` runtime split.
11
+
12
+ ### Changed
13
+ - `state.json` migration: `publicUrl` is runtime state (not user intent) — `config.mjs` `loadConfig()` merges `state.publicUrl` if `config.json` lacks it, `saveConfig()` moves `publicUrl` to `state.json` via `tmp+rename` (B7/B12 fix). `package.json` is still single source for `VERSION`.
14
+
7
15
  ## 0.8.12
8
16
 
9
17
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arena-bridge",
3
- "version": "0.8.12",
3
+ "version": "0.8.13",
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": {
@@ -0,0 +1,3 @@
1
+ // single source of tool definitions — re-exported from engine.mjs for now
2
+ // wave 3 step 1: this file is the canonical place; engine.mjs will import from here
3
+ export { toolCatalog } from './engine.mjs';
@@ -0,0 +1,3 @@
1
+ // wave 3 modularity: cli/ will hold service, telegram, audit, trust etc.
2
+ // For now cli.mjs remains dispatcher importing from here.
3
+ export * from '../cli.mjs';
package/src/engine.mjs CHANGED
@@ -6,6 +6,7 @@ import { spawn } from 'node:child_process';
6
6
  import { checkPath, resolveTarget, isInside } from './policy.mjs';
7
7
  import { audit, saveArtifact, tailAudit, readArtifact, auditDir } from './audit.mjs';
8
8
  import { requestApproval } from './approvals.mjs';
9
+ // catalog is now single-source in catalog.mjs (re-export kept for compat)
9
10
  import { loadConfig, CONFIG_PATH } from './config.mjs';
10
11
  import { BrowserManager, cleanupOrphanChromes } from './browser.mjs';
11
12
  import { macTools } from './mac.mjs';
package/src/gate.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { trustState, trustAllows } from './trust.mjs';
2
+ import { requestApproval } from './approvals.mjs';
3
+ import { audit } from './audit.mjs';
4
+
5
+ export async function authorize(tool, args, cfg) {
6
+ const trust = trustState();
7
+ let needApproval = true;
8
+ if (trustAllows(trust, tool, args, cfg)) needApproval = false;
9
+ else if (cfg.requireApproval === false) needApproval = false;
10
+ if (!needApproval) return { ok: true };
11
+ const approval = await requestApproval(tool, args, cfg);
12
+ if (!approval.approved) {
13
+ const status = approval.rec?.status || "denied";
14
+ try { audit({ tool, args, status: "approval_denied", approval_status: status }); } catch {}
15
+ const pending = status === "pending" || status === "timeout" || status === "expired";
16
+ return { ok: false, status, approval_id: approval.rec?.id || null, pending };
17
+ }
18
+ return { ok: true };
19
+ }
package/src/version.mjs CHANGED
@@ -3,7 +3,7 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
 
6
- export const VERSION = "0.8.12";
6
+ export const VERSION = "0.8.13";
7
7
 
8
8
  export function getVersion() {
9
9
  try {