agentroam 0.2.0-preview.53 → 0.2.0-preview.54

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.
@@ -1,11 +1,8 @@
1
- import { execFile } from "node:child_process";
2
1
  import { setTimeout as delay } from "node:timers/promises";
3
- import { promisify } from "node:util";
4
2
  import { resolveApprovalInput, terminalText } from "./device-pairing.js";
5
3
  import { localServiceRequest } from "./local-service-request.js";
6
4
  import { DesktopAuthorizationInterrupted, DesktopAuthorizationPrompt, withAuthorizationSignal } from "./desktop-authorization-prompt.js";
7
5
  import { withCliProgress, withoutCliProgress } from "../bin/cli-progress.mjs";
8
- const runFile = promisify(execFile);
9
6
  const endpoint = "/api/remote-authorization";
10
7
  async function requestAuthorization(dataDir, body, signal) {
11
8
  const status = await localServiceRequest(dataDir, endpoint, {
@@ -19,12 +16,6 @@ async function requestAuthorization(dataDir, body, signal) {
19
16
  }
20
17
  return status;
21
18
  }
22
- /** Clear only this app's stale permission; deleting the old bundle does not clear TCC. */
23
- export async function resetMacDesktopPermission(permission, signal, run = runFile) {
24
- await run("/usr/bin/tccutil", ["reset", permission === "screen" ? "ScreenCapture" : "Accessibility", "com.agentroam.remote-desktop"], {
25
- signal, timeout: 5000, maxBuffer: 4096,
26
- });
27
- }
28
19
  function recoveryHint(log) {
29
20
  log("稍后重新授权:agentroam desktop authorize;也可在本机浏览器的“远程授权”面板中操作。");
30
21
  }
@@ -74,14 +65,8 @@ export async function authorizeRemoteDesktop(dataDir, context = {}) {
74
65
  if (status[permission])
75
66
  continue;
76
67
  const name = permission === "screen" ? "屏幕录制" : "辅助功能";
77
- log(`正在清理 AgentRoam 的旧${name}授权记录,以便重新请求权限…`);
78
- try {
79
- await run(() => (context.resetPermission ?? resetMacDesktopPermission)(permission, prompt.signal));
80
- }
81
- catch (error) {
82
- prompt.signal.throwIfAborted();
83
- log(`未能清理旧${name}授权:${terminalText(error instanceof Error ? error.message : String(error))}。可在系统设置中移除 AgentRoam Remote Desktop 后重试。`);
84
- }
68
+ // TCC grants belong to the bundle ID across all installed runtimes.
69
+ // A false probe here must never revoke another runtime's permission.
85
70
  log(`正在请求${name}权限,请在系统设置中允许 AgentRoam Remote Desktop…`);
86
71
  status = await withCliProgress(`正在等待${name}权限;输入 s 后回车可跳过`, async () => {
87
72
  let current = await check({ action: "request-permission", permission });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentroam",
3
- "version": "0.2.0-preview.53",
3
+ "version": "0.2.0-preview.54",
4
4
  "description": "Zero-install mobile remote terminal and file console",
5
5
  "type": "module",
6
6
  "bin": {