@blackbelt-technology/pi-dashboard-extension 0.10.0 → 0.12.0

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.
Files changed (103) hide show
  1. package/.pi/skills/browser/SKILL.md +36 -18
  2. package/.pi/skills/browser/UPSTREAM.md +7 -6
  3. package/.pi/skills/browser/references/dashboard-relay.md +21 -20
  4. package/.pi/skills/browser/references/desktop.md +120 -0
  5. package/.pi/skills/browser/references/electron.md +2 -2
  6. package/.pi/skills/browser/references/web.agent.md +342 -166
  7. package/.pi/skills/browser/references/web.md +1003 -528
  8. package/.pi/skills/doctor/SKILL.md +1 -1
  9. package/.pi/skills/doctor/_lib/checks.ts +2 -3
  10. package/.pi/skills/doctor/_lib/derive-tokens.ts +1 -1
  11. package/.pi/skills/doctor/modules/peers.knowledge.hash +1 -1
  12. package/.pi/skills/doctor/modules/peers.md +21 -25
  13. package/.pi/skills/doctor/modules/plugins-bridges.md +5 -4
  14. package/.pi/skills/pi-dashboard/SKILL.md +39 -24
  15. package/.pi/skills/pi-dashboard/commands/dashboard-flow-abort.md +3 -1
  16. package/.pi/skills/pi-dashboard/commands/dashboard-peer-list.md +1 -1
  17. package/.pi/skills/pi-dashboard/commands/dashboard-peer-scan.md +1 -1
  18. package/.pi/skills/pi-dashboard/commands/dashboard-server-config.md +1 -1
  19. package/.pi/skills/pi-dashboard/commands/dashboard-session-spawn.md +2 -2
  20. package/.pi/skills/pi-dashboard/references/api-reference.agent.md +17 -4
  21. package/.pi/skills/pi-dashboard/references/api-reference.md +144 -13
  22. package/.pi/skills/pi-dashboard/references/recipes.md +9 -2
  23. package/.pi/skills/pi-dashboard/references/slash-commands.md +0 -1
  24. package/.pi/skills/pi-dashboard/scripts/dashboard-api.sh +42 -2
  25. package/.pi/skills/pi-dashboard/scripts/dashboard-bus.ts +15 -13
  26. package/.pi/skills/pi-dashboard/scripts/local-proof.ts +40 -0
  27. package/.pi/skills/pi-dashboard/scripts/spawn-command.ts +40 -0
  28. package/.pi/skills/project-access/SKILL.md +190 -0
  29. package/.pi/skills/project-init/SKILL.agent.md +7 -0
  30. package/.pi/skills/project-init/SKILL.md +37 -4
  31. package/package.json +18 -9
  32. package/src/bridge-context.ts +6 -0
  33. package/src/bridge-handlers/dispatch.ts +109 -70
  34. package/src/bridge-handlers/forwarders.ts +19 -42
  35. package/src/bridge-handlers/instance.ts +31 -13
  36. package/src/bridge-handlers/lifecycle.ts +149 -66
  37. package/src/bridge-shutdown.ts +44 -0
  38. package/src/bridge-ticket-client.ts +61 -7
  39. package/src/bridge-tls-checks.ts +79 -0
  40. package/src/bridge.ts +309 -284
  41. package/src/canvas-tool.ts +2 -0
  42. package/src/command-handler.ts +106 -37
  43. package/src/connect-target.ts +23 -0
  44. package/src/connection.ts +153 -38
  45. package/src/credential-guard.ts +300 -0
  46. package/src/custom-entry-forward.ts +27 -18
  47. package/src/dashboard-http-origin.ts +88 -0
  48. package/src/default-model-apply.ts +83 -0
  49. package/src/dev-build.ts +11 -1
  50. package/src/flow-event-wiring.ts +19 -95
  51. package/src/followup-drain.ts +19 -5
  52. package/src/git-link-builder.ts +11 -2
  53. package/src/inbound-limits.ts +138 -0
  54. package/src/local-token-header.ts +77 -6
  55. package/src/model-refresh.ts +69 -0
  56. package/src/path-gate/decide.ts +68 -5
  57. package/src/path-gate/handler.ts +16 -8
  58. package/src/path-gate/index.ts +2 -2
  59. package/src/path-gate/roots.ts +15 -3
  60. package/src/path-gate/suppression.ts +3 -0
  61. package/src/pi-env.d.ts +8 -1
  62. package/src/pi-retry-settings.ts +11 -2
  63. package/src/pinned-endpoint.ts +44 -0
  64. package/src/plugin-event-forward-registry.ts +90 -14
  65. package/src/preview-path-link.ts +151 -0
  66. package/src/project-init/scaffold.ts +98 -35
  67. package/src/project-trust-live.ts +143 -0
  68. package/src/project-trust.ts +178 -30
  69. package/src/provider-model-cache.ts +118 -0
  70. package/src/provider-register.ts +487 -46
  71. package/src/remote-registration-gate.ts +21 -21
  72. package/src/remote-upgrade-preparer.ts +104 -0
  73. package/src/retry-tracker.ts +90 -7
  74. package/src/role-manager.ts +4 -2
  75. package/src/role-model-tools.ts +68 -10
  76. package/src/server-auto-start.ts +69 -3
  77. package/src/server-launcher.ts +26 -8
  78. package/src/server-proof-probe.ts +117 -0
  79. package/src/session-sync.ts +53 -24
  80. package/src/spawn-new-session.ts +22 -0
  81. package/src/steer-buffer.ts +164 -0
  82. package/src/stream-forward-buffer.ts +64 -15
  83. package/src/sudo-askpass/config-reader.ts +32 -0
  84. package/src/sudo-askpass/controller.ts +405 -0
  85. package/src/sudo-askpass/helper-script.ts +69 -0
  86. package/src/sudo-askpass/in-flight.ts +79 -0
  87. package/src/sudo-askpass/index.ts +11 -0
  88. package/src/sudo-askpass/install.ts +143 -0
  89. package/src/sudo-askpass/password-cache.ts +118 -0
  90. package/src/sudo-askpass/prompt-text.ts +55 -0
  91. package/src/sudo-askpass/protocol.ts +18 -0
  92. package/src/sudo-askpass/sudo-mask-registry.ts +52 -0
  93. package/src/terminal-reload.ts +19 -5
  94. package/src/tool-update-filter-registry.ts +210 -0
  95. package/src/vault-delivery.ts +11 -1
  96. package/src/vault-redaction.ts +4 -3
  97. package/.pi/skills/pi-dashboard/commands/dashboard-flow-auto.md +0 -10
  98. package/src/subagent-fanout-admission.ts +0 -234
  99. package/src/subagent-forward-sites.ts +0 -69
  100. package/src/subagent-frame-buffer.ts +0 -245
  101. package/src/subagent-frame-strip.ts +0 -109
  102. package/src/subagent-saturation.ts +0 -196
  103. package/src/subagent-tick-throttle.ts +0 -252
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: browser
3
- description: 'Browser automation via the `agent-browser` CLI. Use when the user needs to drive websites or Electron apps — navigating, forms, clicks, screenshots, data extraction, testing web apps, UI checks, the dashboard Electron shell, or the user''s own logged-in Chrome via the browser relay or Panerelay (SSO/2FA). Triggers: "open a website", "take a screenshot", "test this web app", "use my own browser".'
3
+ description: 'Browser automation via the `agent-browser` CLI: drive websites or Electron apps (forms, clicks, screenshots, scraping, web-app/UI tests, the dashboard Electron shell) or the user''s own logged-in Chrome via browser relay/Panerelay (SSO/2FA); native desktop apps route to agent-desktop. Triggers: "open a website", "take a screenshot", "test this web app", "use my own browser", "control my desktop".'
4
4
  license: Apache-2.0
5
- allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*), Bash(npx @panerelay/setup:*), Bash(curl:*)
5
+ allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*), Bash(npx @panerelay/setup:*), Bash(curl:*), Bash(pi-dashboard:*)
6
6
  metadata:
7
7
  author: pi-dashboard
8
- version: "1.2"
8
+ version: "1.3"
9
9
  vendoredFrom: agent-browser
10
- vendoredVersion: "0.27.0"
11
- verifiedAgainstCli: "0.33.2"
10
+ vendoredVersion: "0.41.2"
11
+ verifiedAgainstCli: "0.41.2"
12
12
  ---
13
13
 
14
14
  # browser
@@ -34,6 +34,12 @@ Three recipes:
34
34
  there is no loopback dashboard. Reference:
35
35
  [`references/own-browser.md`](references/own-browser.md).
36
36
 
37
+ **Native desktop apps** (Finder, Calculator, any non-web UI — "control my
38
+ desktop") are out of scope for `agent-browser`: use `agent-desktop` and read
39
+ [`references/desktop.md`](references/desktop.md) first — install, and the
40
+ macOS Accessibility/Screen Recording trap (permission belongs to
41
+ `pi-dashboard.app`, which must be code-signed).
42
+
37
43
  ## Step 0a — Preflight: `agent-browser` CLI must be installed
38
44
 
39
45
  The skill does **not** bundle the CLI. Verify it through the dashboard tool
@@ -81,7 +87,7 @@ else
81
87
  fi
82
88
  PD_RUNNING=$(pgrep -f "Pi Dashboard|pi-dashboard" >/dev/null 2>&1 && echo yes || echo no)
83
89
  # Browser relay: the dashboard's own capability probe (see dashboard-relay.md).
84
- RELAY=$(curl -fsS http://localhost:8000/api/browser/status 2>/dev/null || echo unavailable)
90
+ RELAY=$(pi-dashboard api GET /api/browser/status 2>/dev/null || echo unavailable)
85
91
  echo "CDP_LIVE=$CDP_LIVE PD_RUNNING=$PD_RUNNING RELAY=$RELAY"
86
92
  ```
87
93
 
@@ -140,24 +146,36 @@ switch `--session`, `--profile`, or provider, and do not run `close --all`.
140
146
 
141
147
  - **Vendoring**: `references/web.md` and `references/electron.md` are
142
148
  snapshots of upstream `agent-browser` skill content (`core` and
143
- `electron`) at CLI version 0.27.0. See [`UPSTREAM.md`](UPSTREAM.md) for
149
+ `electron`) at CLI version 0.41.2. Other upstream skills (`dogfood`,
150
+ `derive-client`, `slack`, `webmcp-gen`, …) are not vendored — load on
151
+ demand with `agent-browser skills list` / `agent-browser skills get <name>`. See [`UPSTREAM.md`](UPSTREAM.md) for
144
152
  refresh procedure and [`LICENSE`](LICENSE) for upstream attribution.
145
- `references/own-browser.md`, `references/dashboard-relay.md`, and
146
- `references/challenge.md` are **authored, not vendored** — an upstream
153
+ `references/own-browser.md`, `references/dashboard-relay.md`,
154
+ `references/challenge.md`, and `references/desktop.md` are **authored, not vendored** — an upstream
147
155
  refresh must not overwrite them.
148
156
  - **Login-state recipes**: `references/dashboard-relay.md` is the preferred
149
157
  path (Pi Dashboard browser relay); `references/own-browser.md` is the legacy
150
158
  Panerelay/native-messaging path for remote sessions with no loopback
151
159
  dashboard.
152
- - **Surfaces share one browser**: the `browser` MCP tool and
153
- `Bash: agent-browser …` drive the *same* daemon and *same* Chrome, with a
154
- shared active page. Probing with one mid-task can silently move the page
155
- out from under the other. Pick one surface per task; use
156
- `--session <name>` for genuinely isolated browsers.
157
- - **Known wrapper bug**: the MCP tool's `eval` echoes the JS source instead
158
- of executing it (and mangles regex escapes) — still present with CLI
159
- 0.33.2, so it is a `pi-agent-browser` wrapper defect, not a CLI one. Use
160
- `Bash: agent-browser eval …` instead.
160
+ - **Three surfaces, one browser**: the `browser` tool (`pi-agent-browser`
161
+ extension), the native MCP server (`agent-browser mcp`, see below) and
162
+ `Bash: agent-browser …` all drive the *same* daemon and *same* Chrome per
163
+ session name, with a shared active page. Probing with one mid-task can
164
+ silently move the page out from under another. Pick one surface per task;
165
+ use `--session <name>` (MCP: `"session"` arg) for isolated browsers.
166
+ - **Known wrapper bug**: the `browser` tool's `eval` echoes the JS source
167
+ instead of executing it (and mangles regex escapes) — still present with
168
+ CLI 0.41.2 / `pi-agent-browser` 0.1.0, a wrapper defect. Use the native MCP
169
+ `agent_browser_eval` or `Bash: agent-browser eval …` instead.
170
+ - **Native MCP server (optional)**: `agent-browser mcp [--tools <profiles>]`
171
+ exposes typed `agent_browser_*` tools over stdio. Profiles: `core`
172
+ (default, small), `network`, `state`, `debug`, `tabs`, `react`, `mobile`,
173
+ `all` (~156 tools). Register in `~/.pi/agent/mcp.json`:
174
+ `{"mcpServers":{"agent-browser":{"type":"stdio","command":"agent-browser","args":["mcp","--tools","core"]}}}`
175
+ (use an absolute `command` path under nvm). Call via
176
+ `mcp({tool:"agent_browser_open", args:{url, session}})`. Each response
177
+ carries ~1 KB `structuredContent` lifecycle JSON — prefer the CLI for long
178
+ loops. One-shot without a stdio session: `agent-browser mcp call <tool> '<json>'`.
161
179
  - **No CLI bundled**: agents installing the bridge extension get the
162
180
  skill text but not the CLI; install on demand per Step 0a.
163
181
  - **User-local override**: if the user's project has its own
@@ -9,18 +9,19 @@ section in `electron.md` are project-specific and not from upstream.
9
9
  `references/own-browser.md` and `scripts/check-panerelay.sh` are authored
10
10
  for this repo (the Panerelay / own-logged-in-browser recipe).
11
11
  `references/challenge.md` is authored for this repo too — the pause / resume
12
- discipline for interactive anti-bot challenges. None of them has an upstream
13
- counterpart.
12
+ discipline for interactive anti-bot challenges. `references/desktop.md` is
13
+ authored too — agent-desktop install + macOS TCC permission recipe. None of
14
+ them has an upstream counterpart.
14
15
 
15
16
  | Field | Value |
16
17
  |------------------------|--------------------------------------------------------------------|
17
18
  | Upstream repo | https://github.com/vercel-labs/agent-browser |
18
- | Upstream tag | `v0.27.0` |
19
- | Upstream commit SHA | `c830d1b67dc18b754e305859f0ae587f858a1447` |
20
- | `agent-browser` CLI | `0.27.0` |
19
+ | Upstream tag | `v0.41.2` |
20
+ | Upstream commit SHA | `d52a5e90c372ec4710c69adc3837ac14bbd852aa` |
21
+ | `agent-browser` CLI | `0.41.2` |
21
22
  | Source-of-truth files | `skills/agent-browser/SKILL.md` (discovery stub) + CLI-served `core` and `electron` skills |
22
23
  | Capture commands | `agent-browser skills get core --full`<br>`agent-browser skills get electron` |
23
- | Refreshed | `2026-05-28` |
24
+ | Refreshed | `2026-11-07` |
24
25
  | License | Apache-2.0 (see [`LICENSE`](LICENSE)) |
25
26
 
26
27
  ## How to refresh
@@ -62,8 +62,9 @@ browser.
62
62
 
63
63
  ## Fallback recipe — REST, for sessions without `browser_connect`
64
64
 
65
- Same dashboard, plain `curl`. Use the dashboard port (`8000` by default;
66
- `PI_DASHBOARD_PORT` overrides). The REST routes do **not** apply the
65
+ Same dashboard, via `pi-dashboard api` (a bare `curl` is refused on these routes under the strict
66
+ `requireLocalProof` default; the CLI sends local proof). Use the dashboard port (`8000` by default;
67
+ `PI_DASHBOARD_PORT` overrides; or pass `--port <n>`). The REST routes do **not** apply the
67
68
  `defaultBrowser` / `onUnavailable` policy: you choose.
68
69
 
69
70
  1. Probe status (Step 1).
@@ -75,8 +76,8 @@ Same dashboard, plain `curl`. Use the dashboard port (`8000` by default;
75
76
  (Step 5).
76
77
 
77
78
  ```bash
78
- curl -s -X POST http://localhost:8000/api/browser/dedicated/connect
79
- # → {"cdpUrl":"ws://127.0.0.1:<port>/ws/browser-cdp/<guid>","instanceId":"inst-…"}
79
+ pi-dashboard api POST /api/browser/dedicated/connect
80
+ # → {"cdpUrl":"ws://127.0.0.1:<port>/ws/browser-cdp/<guid>?ticket=<single-use>","instanceId":"inst-…"}
80
81
  ```
81
82
 
82
83
  The REST routes for the dedicated profile are
@@ -96,7 +97,7 @@ only `connect` and `open`; `stop` and `reset` belong to the user in Settings.
96
97
  ## Step 1 — Probe status
97
98
 
98
99
  ```bash
99
- curl -s http://localhost:8000/api/browser/status
100
+ pi-dashboard api GET /api/browser/status
100
101
  # → {"enabled":true,"canOpenChrome":true,"operatorHosts":true,
101
102
  # "dedicated":{"available":true,"state":"stopped",…}}
102
103
  ```
@@ -117,8 +118,8 @@ Branch on the response:
117
118
  ### Step 1b — Enable the relay (only if `enabled:false`)
118
119
 
119
120
  ```bash
120
- curl -s -X PUT http://localhost:8000/api/browser/enabled \
121
- -H 'content-type: application/json' -d '{"enabled":true}'
121
+ pi-dashboard api PUT /api/browser/enabled \
122
+ --data '{"enabled":true}'
122
123
  ```
123
124
 
124
125
  The kill switch is safe to flip: turning it off closes every live instance
@@ -127,7 +128,7 @@ first (the response returns only after they are gone).
127
128
  ## Step 2 — Pick a profile
128
129
 
129
130
  ```bash
130
- curl -s http://localhost:8000/api/browser/profiles
131
+ pi-dashboard api GET /api/browser/profiles
131
132
  ```
132
133
 
133
134
  Rows are keyed by `profileDirectory`. Pick one with `"installed":true`; match a
@@ -144,12 +145,14 @@ profiles never appear in it.
144
145
  ## Step 3 — Connect to a Chrome profile
145
146
 
146
147
  ```bash
147
- curl -s -X POST http://localhost:8000/api/browser/connect \
148
- -H 'content-type: application/json' \
149
- -d '{"profileDirectory":"Default"}'
148
+ pi-dashboard api POST /api/browser/connect \
149
+ --data '{"profileDirectory":"Default"}'
150
150
  ```
151
151
 
152
- Success returns `{"cdpUrl":"ws://127.0.0.1:<port>/ws/browser-cdp/<guid>","instanceId":"inst-…"}`.
152
+ Success returns `{"cdpUrl":"ws://127.0.0.1:<port>/ws/browser-cdp/<guid>?ticket=<single-use>","instanceId":"inst-…"}`.
153
+ The `?ticket=` is a one-time credential (valid 60 s, spent by the first dial): pass the **whole** `cdpUrl`
154
+ to `agent-browser connect` unchanged, and never log or share it. A client that drops cannot re-dial the same
155
+ URL — call `connect` again for a fresh one.
153
156
  **Keep the `instanceId`** — it is how you disconnect, and the only public handle
154
157
  to this instance.
155
158
 
@@ -170,9 +173,8 @@ see the extra reasons in the next section):
170
173
  `hostId`:
171
174
 
172
175
  ```bash
173
- curl -s -X POST http://localhost:8000/api/browser/connect \
174
- -H 'content-type: application/json' \
175
- -d '{"profileDirectory":"Default","host":"<hostId from Step 2 operatorHosts[]>"}'
176
+ pi-dashboard api POST /api/browser/connect \
177
+ --data '{"profileDirectory":"Default","host":"<hostId from Step 2 operatorHosts[]>"}'
176
178
  ```
177
179
 
178
180
  Rules:
@@ -214,7 +216,7 @@ relay behaves like any CDP endpoint for the allowed surface.
214
216
  ## Step 5 — Disconnect when done
215
217
 
216
218
  ```bash
217
- curl -s -X POST "http://localhost:8000/api/browser/disconnect?instanceId=<instanceId>"
219
+ pi-dashboard api POST "/api/browser/disconnect?instanceId=<instanceId>"
218
220
  ```
219
221
 
220
222
  Do this as soon as the task ends (it closes the dedicated instance too). A live instance holds a **tab group open in
@@ -288,9 +290,8 @@ When a page driven through the dedicated profile needs the user to sign in:
288
290
  1. Open the sign-in page with `POST /api/browser/dedicated/open {url}`, in a
289
291
  **hidden** tab the agent cannot see:
290
292
  ```bash
291
- curl -s -X POST http://localhost:8000/api/browser/dedicated/open \
292
- -H 'content-type: application/json' \
293
- -d '{"url":"https://example.com/login"}'
293
+ pi-dashboard api POST /api/browser/dedicated/open \
294
+ --data '{"url":"https://example.com/login"}'
294
295
  ```
295
296
  Only `https:` URLs are accepted (`400` otherwise). The user can also press
296
297
  **Open to sign in** in Settings → Browser Relay.
@@ -307,7 +308,7 @@ almost always a password-manager extension (LastPass, iCloud Passwords)
307
308
  detaching the debugger. Diagnose it from the audit (`GET /api/browser/audit`):
308
309
 
309
310
  ```bash
310
- curl -s http://localhost:8000/api/browser/audit
311
+ pi-dashboard api GET /api/browser/audit
311
312
  ```
312
313
 
313
314
  A `detach` entry for that `instanceId` with detail `closed:<reason>` (the
@@ -0,0 +1,120 @@
1
+ # Native desktop control (agent-desktop) — install + macOS permissions
2
+
3
+ > AUTHORED for this repo (not vendored). Covers installing
4
+ > [`agent-desktop`](https://agent-browser.dev/desktop) and getting macOS
5
+ > Accessibility / Screen Recording to actually stick when pi runs under the
6
+ > Pi Dashboard. Web pages stay on `agent-browser` (`web.md`); Electron web
7
+ > contents stay on `electron.md`.
8
+
9
+ `agent-desktop` reads a native app's accessibility tree and returns JSON with
10
+ `@<snapshot>:eN` refs. Loop: snapshot (skeleton) → drill → act on ref → read
11
+ again to verify. No model inside; one JSON envelope per command.
12
+
13
+ ## 1. Install + preflight
14
+
15
+ Ask the user before installing (global npm install = their choice):
16
+
17
+ ```bash
18
+ npm install -g agent-desktop # macOS / Windows / Linux
19
+ agent-desktop status | jq -c '.data.permissions | map_values(.state)'
20
+ agent-desktop skills get desktop # upstream usage guide — load before driving apps
21
+ ```
22
+
23
+ - npm may warn `install-scripts … not yet covered by allowScripts` and skip
24
+ `postinstall`. The npm tarball already ships the native binaries; the CLI
25
+ works without it. Reinstall with `--allow-scripts=agent-desktop` only if a
26
+ binary is actually missing.
27
+ - Target: `{"accessibility":"granted","screen_recording":"granted"}`.
28
+ `automation: "unknown"` is fine.
29
+
30
+ ## 2. macOS: who must hold the permission?
31
+
32
+ TCC (the macOS privacy database) grants by **responsible process**, not by
33
+ the binary that calls the API. Under Pi Dashboard the chain is
34
+
35
+ ```
36
+ pi-dashboard.app → bundled node → pi (nvm node) → bash → agent-desktop
37
+ ```
38
+
39
+ and TCC charges every call to **`pi-dashboard.app`**
40
+ (`com.blackbelt-technology.pi-dashboard`) — even for sessions whose node
41
+ process has been reparented to `launchd` after a dashboard restart. Granting
42
+ Terminal, the bundled `node`, the nvm `node`, or the `agent-desktop` binary
43
+ does **nothing** for dashboard sessions. (Running pi from Terminal/iTerm
44
+ instead → that terminal app is responsible.)
45
+
46
+ So: grant **pi-dashboard** in System Settings → Privacy & Security →
47
+ **Accessibility** AND **Screen Recording**.
48
+
49
+ ```bash
50
+ agent-desktop permissions --guide # opens the right Settings pane
51
+ open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"
52
+ ```
53
+
54
+ ## 3. Diagnose — read TCC's verdict, don't guess
55
+
56
+ The toggle UI lies (entry present but off, or on but unverifiable). Check the
57
+ database and the daemon log:
58
+
59
+ ```bash
60
+ # What is stored (auth_value 2 = allowed, 0 = denied/off). Readable without FDA.
61
+ sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" \
62
+ "select service,client,auth_value,datetime(last_modified,'unixepoch','localtime')
63
+ from access where client like '%pi-dashboard%' or client like '/%'"
64
+
65
+ # Who TCC thinks is responsible + why it said no
66
+ agent-desktop status >/dev/null 2>&1; sleep 2
67
+ log show --last 10s --info --debug \
68
+ --predicate 'subsystem == "com.apple.TCC" AND process == "tccd"' --style compact \
69
+ | grep -E 'AttributionChain|matchesCodeRequirement|Failed to match|AUTHREQ_RESULT' | cut -c1-400
70
+ ```
71
+
72
+ Read it as:
73
+
74
+ | Log / DB evidence | Meaning | Fix |
75
+ |---|---|---|
76
+ | `responsible_path=/Applications/pi-dashboard.app/...` | dashboard app is the subject | grant pi-dashboard (§2) |
77
+ | `SecStaticCodeCheckValidity … status: -67050` + `Failed to match existing code requirement` | app is **unsigned** (`codesign -dv` → "code object is not signed at all"); stored grant can never verify → always denied | §4 |
78
+ | DB row `kTCCServiceAccessibility … pi-dashboard … 0` | entry exists but toggle is **off** (common after re-adding) | switch it on, recheck |
79
+ | no pi-dashboard row at all | never granted | add with `+` |
80
+
81
+ ## 4. Fix: unsigned pi-dashboard.app
82
+
83
+ Release builds are not yet Developer-ID signed (OpenSpec change
84
+ `macos-notarization`). Until then, ad-hoc sign locally and re-grant:
85
+
86
+ ```bash
87
+ codesign -dv /Applications/pi-dashboard.app 2>&1 | head -2 # "not signed at all"?
88
+ codesign --force --deep --sign - /Applications/pi-dashboard.app
89
+ codesign --verify --deep /Applications/pi-dashboard.app && echo SIGNED_OK
90
+ tccutil reset Accessibility com.blackbelt-technology.pi-dashboard
91
+ tccutil reset ScreenCapture com.blackbelt-technology.pi-dashboard
92
+ ```
93
+
94
+ Then the user: quit + reopen pi-dashboard, enable it in **both** panes,
95
+ confirm. Re-run `agent-desktop status`.
96
+
97
+ - Ask before running — it modifies the installed app.
98
+ - Every dashboard update replaces the bundle → unsigned again → repeat §4.
99
+ - Restarting the app alone never fixes an unsigned-app denial.
100
+
101
+ ## 5. Verify
102
+
103
+ ```bash
104
+ agent-desktop status | jq -c '.data.permissions | map_values(.state)' # both "granted"
105
+ agent-desktop list-windows --app Finder
106
+ agent-desktop snapshot --app Finder --window-id <id> --skeleton -i --compact | jq -c '{ok}'
107
+ ```
108
+
109
+ `AMBIGUOUS_TARGET` = several windows match → pick one with `--window-id`
110
+ (from `list-windows`); not a permission problem.
111
+
112
+ ## Pitfalls
113
+
114
+ - Don't add broad interpreters (nvm `node`) to Accessibility as a "try
115
+ everything" step: it is useless under the dashboard (§2) and lets **any**
116
+ node script control the desktop. Remove leftovers.
117
+ - `agent-desktop` only sees UIs that publish an accessibility tree; no pixel
118
+ matching.
119
+ - Keep one surface per task; for Chromium/Electron web contents hand the
120
+ DevTools port to `agent-browser` (see `electron.md`).
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  Vendored from agent-browser upstream via `agent-browser skills get electron`
3
- at CLI version 0.27.0 (upstream tag v0.27.0,
4
- commit c830d1b67dc18b754e305859f0ae587f858a1447).
3
+ at CLI version 0.41.2 (upstream tag v0.41.2,
4
+ commit d52a5e90c372ec4710c69adc3837ac14bbd852aa).
5
5
  Frontmatter stripped — this is a reference doc, not a standalone skill.
6
6
  License: Apache-2.0 (see ../LICENSE).
7
7
  See ../UPSTREAM.md for refresh procedure.