Skip to content

Commit 3b2c2b7

Browse files
committed
feat(mcp): trim the new tool descriptions and restore lost guidance
Brings the descriptions of the tools added since this branch started under 600 characters, so the description length test passes after merging main. Restores guidance the first trim dropped: page selection per tool, the change-detection record workflow, write refusals for secret and redacted fields, and the side effects of navigate probe. Puts back the formatting of files the branch reformatted.
1 parent 91ed1a3 commit 3b2c2b7

34 files changed

Lines changed: 66 additions & 113 deletions

‎app/src/__tests__/store-history.test.ts‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,16 @@ afterEach(() => {
5757
class TabsHost {
5858
readonly seq = signal(2);
5959
readonly truncated = signal<number | undefined>(undefined);
60-
loader = vi.fn(
61-
async (seq: number): Promise<EntryDetailAnswer> => ({
62-
ok: true,
63-
detail: {
64-
seq,
65-
storeId: 'store',
66-
before: { count: 1 },
67-
after: { count: 2 },
68-
diff: [{ path: 'count', op: 'change', before: 1, after: 2 }],
69-
},
70-
}),
71-
);
60+
loader = vi.fn(async (seq: number): Promise<EntryDetailAnswer> => ({
61+
ok: true,
62+
detail: {
63+
seq,
64+
storeId: 'store',
65+
before: { count: 1 },
66+
after: { count: 2 },
67+
diff: [{ path: 'count', op: 'change', before: 1, after: 2 }],
68+
},
69+
}));
7270
}
7371

7472
describe('Entry tabs', () => {

‎app/src/pages/network-inspector.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,7 @@ const HTTP_STATUS_OPTIONS: SelectOption[] = [
789789
role="region"
790790
[attr.aria-label]="detail.error ? 'Response error' : 'Response body'"
791791
[class.error]="!!detail.error && !detail.cancelled"
792-
>{{ detail.error ?? previewText(detail) ?? '(no body)' }}</pre
793-
>
792+
>{{ detail.error ?? previewText(detail) ?? '(no body)' }}</pre>
794793
<app-http-headers
795794
[callId]="detail.id"
796795
[request]="detail.requestHeaders"

‎app/src/pages/query-types.ts‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@ export function statusTone(
135135

136136
/** The status filters of the Queries view. */
137137
export type QueryFilter =
138-
| 'all'
139-
| 'fetching'
140-
| 'success'
141-
| 'error'
142-
| 'pending'
143-
| 'stale'
144-
| 'inactive';
138+
'all' | 'fetching' | 'success' | 'error' | 'pending' | 'stale' | 'inactive';
145139

146140
export function matchesQueryFilter(query: QueryInfo, filter: QueryFilter): boolean {
147141
switch (filter) {

‎apps/docs/src/content/agents/mcp-server.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Your client can ask you before it runs them. To drop them from the server, set `
276276

277277
### Pages and tabs
278278

279-
Each browser tab reports on its own and gets a page id, and so does an [Angular Native](../getting-started/angular-native.md) or [NativeScript](../getting-started/nativescript.md) app. `list-pages` lists them with their platform. Tools that read live data use the most recent page by default. Pass `page` to pick another tab (`inspect-providers`, `highlight`, `inspect-component` and `defer-blocks` also accept `pageId`). An id that no tab reports gets an answer that lists the tabs that do, instead of data from another tab. The server drops pages that stop reporting after a short time.
279+
Each browser tab reports on its own and gets a page id, and so does an [Angular Native](../getting-started/angular-native.md) or [NativeScript](../getting-started/nativescript.md) app. `list-pages` lists them with their platform. Most tools that read live data use the most recent page by default, and [Agent tools](./tools.md) names the ones that don't. Pass `page` to pick another tab (`inspect-providers`, `highlight`, `inspect-component` and `defer-blocks` also accept `pageId`). An id that no tab reports gets an answer that lists the tabs that do, instead of data from another tab. The server drops pages that stop reporting after a short time.
280280

281281
## Where to next
282282

‎apps/docs/src/content/agents/tools.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ An image of one component's host element as the page renders it now. The answer
292292
| Argument | Required | Value |
293293
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------- |
294294
| `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+
| `page` | no | The page id, from `list-pages`. Without it, every page is searched, newest first. |
296296
| `pageId` | no | Same as `page`. |
297297

298298
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`.

‎apps/docs/src/content/getting-started/configuration.md‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,7 @@ type PangularInspector =
105105
| 'plugins';
106106

107107
type PangularAction =
108-
| 'forms'
109-
| 'router'
110-
| 'ngrx'
111-
| 'http'
112-
| 'analog'
113-
| 'components'
114-
| 'tanstackQuery'
115-
| 'plugins';
108+
'forms' | 'router' | 'ngrx' | 'http' | 'analog' | 'components' | 'tanstackQuery' | 'plugins';
116109

117110
interface PangularConfig {
118111
inspectors?: Partial<Record<PangularInspector, boolean>>;

‎packages/devtools/src/__tests__/leaks-real.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ import {
1818
const updates = new Subject<number>();
1919

2020
const effect = (core as unknown as Record<string, unknown>)['effect'] as
21-
| ((fn: () => void) => unknown)
22-
| undefined;
21+
((fn: () => void) => unknown) | undefined;
2322

2423
class LeakyCard {
2524
readonly seats = writableSignal(3);

‎packages/devtools/src/browser-tools.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ export function attachBrowserTools(
8787

8888
async function run(name: string, args: unknown): Promise<string> {
8989
const answer = (await my.rpc.call('call-browser-tool', { pageId, name, args })) as
90-
| { text?: unknown; isError?: unknown }
91-
| undefined;
90+
{ text?: unknown; isError?: unknown } | undefined;
9291
const text =
9392
typeof answer?.text === 'string' ? answer.text : 'The devtools server gave no answer.';
9493
if (answer?.isError) throw new Error(text);

‎packages/devtools/src/component-values.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export interface ComponentValueRequest {
4141
}
4242

4343
export type ComponentValueResult =
44-
| { ok: true; component: string; path: string[]; value: unknown }
45-
| { ok?: false; error: string };
44+
{ ok: true; component: string; path: string[]; value: unknown } | { ok?: false; error: string };
4645

4746
/** The key of an opened level in `ComponentDetail.expanded`. */
4847
export function valuePathKey(path: readonly string[], directive?: number): string {

0 commit comments

Comments
 (0)