agentroam 0.2.0-preview.68 → 0.2.0-preview.70

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.
@@ -19,6 +19,11 @@ async function requestAuthorization(dataDir, body, signal) {
19
19
  function recoveryHint(log) {
20
20
  log("Authorize later: agentroam desktop authorize, or use the Remote Authorization panel in a local browser.");
21
21
  }
22
+ function stalePermissionHint(permission, log) {
23
+ const service = permission === "screen" ? "ScreenCapture" : "Accessibility";
24
+ log("If System Settings already shows AgentRoam Remote Desktop as enabled, macOS may still be using a grant for an older component signature.");
25
+ log(`Manual repair only after closing other AgentRoam instances: /usr/bin/tccutil reset ${service} com.agentroam.remote-desktop; then rerun agentroam desktop authorize.`);
26
+ }
22
27
  function reportComponent(status, log) {
23
28
  if (!status.component)
24
29
  return;
@@ -96,6 +101,7 @@ export async function authorizeRemoteDesktop(dataDir, context = {}) {
96
101
  });
97
102
  if (!status[permission]) {
98
103
  log(`${name} permission was not granted. Sharing was not enabled.`);
104
+ stalePermissionHint(permission, log);
99
105
  recoveryHint(log);
100
106
  return false;
101
107
  }
@@ -3,9 +3,11 @@ import { homedir } from "node:os";
3
3
  import { join, resolve } from "node:path";
4
4
  export class LocalServiceHttpError extends Error {
5
5
  status;
6
- constructor(status) {
7
- super(`本机服务请求失败 (HTTP ${status})`);
6
+ detail;
7
+ constructor(status, detail) {
8
+ super(detail ? `本机服务请求失败 (HTTP ${status}): ${detail}` : `本机服务请求失败 (HTTP ${status})`);
8
9
  this.status = status;
10
+ this.detail = detail;
9
11
  }
10
12
  }
11
13
  /** Resolve an identity-checked loopback service; never send its token to a tunnel. */
@@ -53,7 +55,15 @@ export async function localServiceRequest(dataDir, path, options = {}) {
53
55
  ...(options.body === undefined ? {} : { body: JSON.stringify(options.body) }),
54
56
  redirect: "error", signal: requestSignal(options.timeoutMs ?? 5000),
55
57
  });
56
- if (!response.ok)
57
- throw new LocalServiceHttpError(response.status);
58
+ if (!response.ok) {
59
+ let detail;
60
+ try {
61
+ const body = await response.json();
62
+ if (typeof body.error === "string" && body.error.trim())
63
+ detail = body.error.trim().slice(0, 500);
64
+ }
65
+ catch { /* Preserve the status when the service did not return JSON. */ }
66
+ throw new LocalServiceHttpError(response.status, detail);
67
+ }
58
68
  return response.json();
59
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentroam",
3
- "version": "0.2.0-preview.68",
3
+ "version": "0.2.0-preview.70",
4
4
  "description": "Zero-install mobile remote terminal and file console",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,12 +27,12 @@
27
27
  "ws": "^8.21.3"
28
28
  },
29
29
  "optionalDependencies": {
30
- "agentroam-runtime-darwin-arm64": "0.2.0-preview.68",
31
- "agentroam-runtime-win32-x64": "0.2.0-preview.68",
30
+ "agentroam-runtime-darwin-arm64": "0.2.0-preview.70",
31
+ "agentroam-runtime-win32-x64": "0.2.0-preview.70",
32
32
  "agentroam-cloudflared-darwin-arm64": "0.2.0-preview.58",
33
33
  "agentroam-cloudflared-win32-x64": "0.2.0-preview.58",
34
- "agentroam-tui-darwin-arm64": "0.2.0-preview.68",
35
- "@caoqu/agentroam-tui-win32-x64": "0.2.0-preview.68"
34
+ "agentroam-tui-darwin-arm64": "0.2.0-preview.70",
35
+ "@caoqu/agentroam-tui-win32-x64": "0.2.0-preview.70"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^22.0.0",