Skip to content

Commit 14b95cb

Browse files
author
Natallia Harshunova
committed
formatting
1 parent b129cd4 commit 14b95cb

File tree

6 files changed

+29
-21
lines changed

6 files changed

+29
-21
lines changed

src/McpContext.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ import {takeSnapshot} from './tools/snapshot.js';
3535
import {CLOSE_PAGE_ERROR} from './tools/ToolDefinition.js';
3636
import type {Context, DevToolsData} from './tools/ToolDefinition.js';
3737
import type {TraceResult} from './trace-processing/parse.js';
38-
import { ExtensionRegistry, type InstalledExtension } from './utils/ExtensionRegistry.js';
38+
import {
39+
ExtensionRegistry,
40+
type InstalledExtension,
41+
} from './utils/ExtensionRegistry.js';
3942
import {WaitForHelper} from './WaitForHelper.js';
4043

4144
export interface TextSnapshotNode extends SerializedAXNode {
@@ -770,4 +773,3 @@ export class McpContext implements Context {
770773
return this.#extensionRegistry.list();
771774
}
772775
}
773-

src/McpResponse.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ export class McpResponse implements Response {
105105
pagination:
106106
options?.pageSize || options?.pageIdx
107107
? {
108-
pageSize: options.pageSize,
109-
pageIdx: options.pageIdx,
110-
}
108+
pageSize: options.pageSize,
109+
pageIdx: options.pageIdx,
110+
}
111111
: undefined,
112112
resourceTypes: options?.resourceTypes,
113113
includePreservedRequests: options?.includePreservedRequests,
@@ -132,9 +132,9 @@ export class McpResponse implements Response {
132132
pagination:
133133
options?.pageSize || options?.pageIdx
134134
? {
135-
pageSize: options.pageSize,
136-
pageIdx: options.pageIdx,
137-
}
135+
pageSize: options.pageSize,
136+
pageIdx: options.pageIdx,
137+
}
138138
: undefined,
139139
types: options?.types,
140140
includePreservedMessages: options?.includePreservedMessages,
@@ -553,12 +553,14 @@ Call ${handleDialog.name} to handle it before continuing.`);
553553
} else {
554554
const parts = [];
555555
for (const extension of data.extensions) {
556-
parts.push([
557-
`Name: ${extension.name}`,
558-
`ID: ${extension.id}`,
559-
`Version: ${extension.version}`,
560-
`Status: ${extension.isEnabled ? 'Enabled' : 'Disabled'}`,
561-
].join('\n'));
556+
parts.push(
557+
[
558+
`Name: ${extension.name}`,
559+
`ID: ${extension.id}`,
560+
`Version: ${extension.version}`,
561+
`Status: ${extension.isEnabled ? 'Enabled' : 'Disabled'}`,
562+
].join('\n'),
563+
);
562564
}
563565
response.push(parts.join('\n\n'));
564566
}

src/tools/ToolDefinition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
Viewport,
1414
} from '../third_party/index.js';
1515
import type {InsightName, TraceResult} from '../trace-processing/parse.js';
16-
import type { InstalledExtension } from '../utils/ExtensionRegistry.js';
16+
import type {InstalledExtension} from '../utils/ExtensionRegistry.js';
1717
import type {PaginationOptions} from '../utils/types.js';
1818

1919
import type {ToolCategory} from './categories.js';

src/utils/ExtensionRegistry.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export interface InstalledExtension {
1818
export class ExtensionRegistry {
1919
#extensions = new Map<string, InstalledExtension>();
2020

21-
async registerExtension(id: string, extensionPath: string): Promise<InstalledExtension> {
21+
async registerExtension(
22+
id: string,
23+
extensionPath: string,
24+
): Promise<InstalledExtension> {
2225
const manifestPath = path.join(extensionPath, 'manifest.json');
2326
const manifestContent = await fs.readFile(manifestPath, 'utf-8');
2427
const manifest = JSON.parse(manifestContent);
@@ -48,4 +51,3 @@ export class ExtensionRegistry {
4851
return this.#extensions.get(id);
4952
}
5053
}
51-

tests/McpResponse.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ describe('extensions', () => {
734734
},
735735
];
736736
response.setListExtensions();
737-
const { content, structuredContent } = await response.handle(
737+
const {content, structuredContent} = await response.handle(
738738
'test',
739739
context,
740740
);
@@ -744,4 +744,3 @@ describe('extensions', () => {
744744
});
745745
});
746746
});
747-

tests/tools/extensions.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@ describe('extension', () => {
7777
it('lists installed extensions', async () => {
7878
await withMcpContext(async (response, context) => {
7979
const setListExtensionsSpy = sinon.spy(response, 'setListExtensions');
80-
await listExtensions.handler({ params: {} }, response, context);
81-
assert.ok(setListExtensionsSpy.calledOnce, 'setListExtensions should be called');
80+
await listExtensions.handler({params: {}}, response, context);
81+
assert.ok(
82+
setListExtensionsSpy.calledOnce,
83+
'setListExtensions should be called',
84+
);
8285
});
8386
});
8487
});

0 commit comments

Comments
 (0)