You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ab7ed0e
Browse filesBrowse the repository at this point in the historyBrowse files
fix(mcp): keep page tools on the calling page and mask more screenshot fields
Page tools now always answer for the page that registered them, list only
page-scoped tools and source scans, and leave other tabs out of their
answers. Screenshots mask fields and custom controls by every name
attribute. Skills install refuses symbolic links, `since` rejects out of
range times, and the docs match the tool lists.
Copy file name to clipboardExpand all lines: apps/docs/src/content/agents/browser-agents.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,16 @@ Each call goes from the page to the devtools server, which runs the same handler
24
24
25
25
Only tools in the `read`[safety tier](./tools.md#action-tools). Action and destructive tools, such as `navigate`, `fill-form` or `clear-recordings`, never reach the page.
26
26
27
+
Of the `read` tools, the page registers the ones that answer for one page (they take `page` or `pageId`) and the ones that read your source, such as `get-routes`, `get-components` and `build-meta`. These stay with the [MCP server](./mcp-server.md):
|`list-ssr-requests`, `explain-ssr-request`, `list-ssr-overrides`, `list-http-rules`, `analog-server-calls`| They answer about the whole server, for every tab. |
33
+
|`screenshot-component`| A page tool answers with text, not an image, and the capture draws the whole component. |
34
+
|`highlight`| It draws on the page and changes the selection in open panels. |
35
+
|`open-in-panel`| It switches the panels that are open. |
36
+
27
37
The config decides the rest, as for MCP clients:
28
38
29
39
| Option | Effect on the page tools |
@@ -37,7 +47,7 @@ See [Configuration](../getting-started/configuration.md#inspectors-and-agent-too
37
47
38
48
## How the tools answer
39
49
40
-
- A tool that takes `page` or `pageId` answers for the page that registered it, unless the agent names another page.
50
+
- A tool that takes `page` or `pageId`always answers for the page that registered it. A `page` or `pageId`the agent passes is replaced with that page's id, so a page never reads another tab. When the page has not reported that data, the answer says so without naming other tabs.
41
51
- The answer is the markdown or JSON an MCP client gets. Secret names, JWTs and bearer tokens are masked, as in every answer. See [Redaction](../security.md).
42
52
- Answers over 100,000 characters are cut, with a note to narrow the call.
43
53
- A WebMCP call resolves to `{content: [{type: 'text', text}]}`. A refused or failed call rejects with the reason.
@@ -70,7 +80,7 @@ The WebMCP registration carries the `readOnlyHint`, `untrustedContentHint` and `
70
80
Without WebMCP, the page only listens for `devtoolstooldiscovery`. It writes nothing to your app's DOM. The [Forms](../inspectors/forms.md) tab leaves these tools out of its WebMCP list, which shows the tools of your app.
71
81
72
82
<ngmd-callouttype="warning"title="Any script on the page can call them">
73
-
In-page agents and other scripts can list WebMCP tools and run them. The tools only read, but they read the server's view of your app, including the source scan. Leave <code>agent.browserTools</code> off if your development page loads scripts you don't trust.
83
+
In-page agents and other scripts can list WebMCP tools and run them. The tools don't change your app's data, but they read the server's view of your page, including the source scan, and <code>inspect-component</code> selects the instance it reads in open panels. Leave <code>agent.browserTools</code> off if your development page loads scripts you don't trust.
|`selector`| yes | An instance id from the `component-tree` resource (like `c12`), a class name, a host tag or any CSS selector. |
295
+
|`page`| no | The page id, from `list-pages`. Defaults to the most recent page. |
295
296
|`pageId`| no | Same as `page`. |
296
297
297
298
The page draws a copy of the element, not the screen: it copies the element's DOM with every computed style written inline into an SVG, and draws that on a canvas that is never added to the page. Nothing in the app changes, no app code runs, and a component scrolled out of view or behind a dialog is drawn all the same. A class name or tag that matches several instances captures the first and lists the ids of all of them. A CSS selector captures the first element it matches on the most recent page, or on `page`.
298
299
299
-
The copy masks what the [redaction](../security.md) masks in form values: password fields, fields whose name, `formControlName` or `id` looks secret (plus `redaction.secretNames`), and fields with a secret `autocomplete`. Elements marked `data-private`, `.sentry-mask`, `.rr-mask` or `data-pangular="mask"` become grey blocks, and `data-pangular="unmask"` keeps a field. JWTs, bearer tokens and secret `key=value` pairs in text are masked too.
300
+
The copy masks what the [redaction](../security.md) masks in form values: password fields, fields where any of `formControlName`, `ng-reflect-name`, `name` or `id` looks secret (plus `redaction.secretNames`), and fields with a secret `autocomplete`. Any other element named that way, such as a custom form control `<app-pin formControlName="pin">`, becomes a grey block with everything inside it, its inputs included. Elements marked `data-private`, `.sentry-mask`, `.rr-mask` or `data-pangular="mask"` become grey blocks, and `data-pangular="unmask"` keeps a field. JWTs, bearer tokens and secret `key=value` pairs in text are masked too.
|`inspectors.<name>`|`true`|`false` removes the inspector: no tab or dock, no page collector, no RPC functions, and no agent tools or resources. Its actions are blocked too. |
135
-
|`agent.readOnly`|`false`|`true` keeps only the agent tools in the `read`[safety tier](../agents/tools.md#action-tools). It drops `form-action`, `fill-form`, `navigate`, `dispatch-ngrx-action`, `set-http-rule`, `remove-http-rule`, `set-component-property`, `set-signal`, `record-pipes`, `track-subscriptions`, `analog-call-api` and `clear-recordings`. `change-detection` stays without its `record` argument. |
136
-
|`agent.tools.<name>`|`true`|`false` hides one inspector's agent tools and resources, and its [shared-state keys](../agents/resources.md#shared-state) over HTTP MCP. The tab stays. |
137
-
|`agent.browserTools`|`false`|`true` registers the `read` agent tools on the page for [browser agents](../agents/browser-agents.md) (WebMCP and Chrome DevTools for agents). Off by default, because any script on the development page could then call them. |
|`inspectors.<name>`|`true`|`false` removes the inspector: no tab or dock, no page collector, no RPC functions, and no agent tools or resources. Its actions are blocked too. |
135
+
|`agent.readOnly`|`false`|`true` keeps only the agent tools in the `read`[safety tier](../agents/tools.md#action-tools). It drops every `action` and `destructive` tool in the [tier table](../agents/tools.md#action-tools): `form-action`, `fill-form`, `navigate`, `dispatch-ngrx-action`, `set-http-rule`, `remove-http-rule`, `set-ssr-override`, `remove-ssr-override`, `set-component-property`, `set-signal`, `watch-signal`, `record-pipes`, `track-subscriptions`, `analog-call-api` and `clear-recordings`. `change-detection` stays without its `record` argument, and `hydration` without its `overlay` argument. |
136
+
|`agent.tools.<name>`|`true`|`false` hides one inspector's agent tools and resources, and its [shared-state keys](../agents/resources.md#shared-state) over HTTP MCP. The tab stays. |
137
+
|`agent.browserTools`|`false`|`true` registers the `read` agent tools on the page for [browser agents](../agents/browser-agents.md) (WebMCP and Chrome DevTools for agents). Off by default, because any script on the development page could then call them. |
138
138
139
139
`agent.tools` has the same keys as `inspectors`. An inspector that is off has no agent tools, whatever `agent.tools` says.
140
140
@@ -144,15 +144,15 @@ If you open a tab that is turned off, the panel says so, shows the option that t
144
144
145
145
Actions are the writes that the panel and agents make to your app or the server.
|`actions.forms`|`true`| Form writes: set value, fill, mark touched, untouched, dirty or pristine, touch all, revalidate, reset, enable, disable, submit and restore. Drops `form-action` and `fill-form`. |
150
-
|`actions.router`|`true`| Navigate, abort, replay and probe, and clearing the navigations list. Drops router clearing in `clear-recordings`. The `navigate` agent tool stays for `instrument` and `resolve-lazy` and refuses the other four. |
151
-
|`actions.ngrx`|`true`| Restoring NgRx state from the change log and dispatching `@ngrx/store` actions. Drops the `dispatch-ngrx-action` agent tool. |
152
-
|`actions.http`|`true`| Editing fault injection rules and SSR overrides, and clearing the HTTP timeline. Drops the `set-http-rule` and `remove-http-rule`agent tools and HTTP clearing in `clear-recordings`.|
153
-
|`actions.analog`|`true`| The Analog request playground and clearing server calls. Drops the `analog-call-api` agent tool and Analog clearing in `clear-recordings`. |
154
-
|`actions.components`|`true`| Editing component inputs, properties and writable signals from the **Components** tab. Drops the `set-component-property` and `set-signal` agent tools. |
|`actions.forms`|`true`| Form writes: set value, fill, mark touched, untouched, dirty or pristine, touch all, revalidate, reset, enable, disable, submit and restore. Drops `form-action` and `fill-form`. |
150
+
|`actions.router`|`true`| Navigate, abort, replay and probe, and clearing the navigations list. Drops router clearing in `clear-recordings`. The `navigate` agent tool stays for `instrument` and `resolve-lazy` and refuses the other four. |
151
+
|`actions.ngrx`|`true`| Restoring NgRx state from the change log and dispatching `@ngrx/store` actions. Drops the `dispatch-ngrx-action` agent tool. |
152
+
|`actions.http`|`true`| Editing fault injection rules and SSR overrides, and clearing the HTTP timeline. Drops the `set-http-rule`, `remove-http-rule`, `set-ssr-override` and `remove-ssr-override`agent tools and HTTP clearing in `clear-recordings`. |
153
+
|`actions.analog`|`true`| The Analog request playground and clearing server calls. Drops the `analog-call-api` agent tool and Analog clearing in `clear-recordings`. |
154
+
|`actions.components`|`true`| Editing component inputs, properties and writable signals from the **Components** tab. Drops the `set-component-property` and `set-signal` agent tools. |
155
+
|`actions`|`true`| All of the above. |
156
156
157
157
Pass `actions: false` to block every action, or an object to block some. Keys you leave out of the object stay on.
Copy file name to clipboardExpand all lines: apps/docs/src/content/inspectors/components.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -455,7 +455,7 @@ Press Escape in the filter box to clear it. When the filter matches nothing, **C
455
455
|`pangular:list-components`| tool | Returns the live tree of one page as an indented outline with routed, directive host and hydration markers. Takes a `filter` with the search syntax, a `depth` and `directiveHosts`. |
456
456
|`pangular:defer-blocks`| tool | Lists the `@defer` blocks of each page, and flags blocks that failed, blocks stuck on their placeholder and blocks still dehydrated. |
457
457
|`pangular:for-blocks`| tool | Lists the `@for` blocks of each page with their item count, track kind and `@empty` block. |
458
-
|`pangular:hydration`| tool | Returns the hydration status of each page rendered on the server, and turns the outline on the page on or off. An action when it turns the outline on or off.|
458
+
|`pangular:hydration`| tool | Returns the hydration status of each page rendered on the server, and turns the outline on the page on or off. Turning the outline on or off is an action. |
459
459
|`pangular:change-detection`| tool | Starts, stops or clears a change detection recording, turns the live views on or off, and returns the slowest and most often checked components, hook, output and afterRender time, the latest cycles, or an export. |
460
460
|`pangular:diagnose-change-detection`| tool | What started the recorded cycles, components that depend on zone.js, wasted checks, inputs that break OnPush, and OnPush hints. |
461
461
|`pangular:set-component-property`| tool | Writes an input or property of one instance and runs change detection. An action. |
0 commit comments