Skip to content

Commit fb1d6d5

Browse files
authored
Merge pull request #3 from asteroidai/ed/fix-formatting
Lint before rebase
2 parents e7a21ba + b310be1 commit fb1d6d5

14 files changed

+236
-204
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ Playwright MCP server supports following arguments. They can be provided in the
150150
<!--- Options generated by update-readme.js -->
151151

152152
```
153-
> npx @playwright/mcp@latest --help
153+
> npx asteroid-playwright-mcp@latest --help
154154
--allowed-origins <origins> semicolon-separated list of origins to allow the
155155
browser to request. Default is to allow all.
156156
--blocked-origins <origins> semicolon-separated list of origins to block the

context.d.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@
1414
* limitations under the License.
1515
*/
1616

17-
import type * as playwright from "playwright";
17+
import type * as playwright from 'playwright';
1818
import type {
1919
ImageContent,
2020
TextContent,
21-
} from "@modelcontextprotocol/sdk/types.js";
22-
import type { Tab } from "./tab.js";
21+
} from '@modelcontextprotocol/sdk/types.js';
22+
import type { Tab } from './tab.js';
2323

2424
/**
2525
* Tool capability types
2626
*/
2727
export type ToolCapability =
28-
| "core"
29-
| "tabs"
30-
| "pdf"
31-
| "history"
32-
| "wait"
33-
| "files"
34-
| "install"
35-
| "testing";
28+
| 'core'
29+
| 'tabs'
30+
| 'pdf'
31+
| 'history'
32+
| 'wait'
33+
| 'files'
34+
| 'install'
35+
| 'testing';
3636

3737
/**
3838
* Configuration for the MCP server
3939
*/
4040
export type FullConfig = {
4141
browser: {
4242
browserAgent?: string;
43-
browserName: "chromium" | "firefox" | "webkit";
43+
browserName: 'chromium' | 'firefox' | 'webkit';
4444
isolated?: boolean;
4545
userDataDir?: string;
4646
launchOptions?: playwright.LaunchOptions;
@@ -60,20 +60,20 @@ export type FullConfig = {
6060
allowedOrigins?: string[];
6161
blockedOrigins?: string[];
6262
};
63-
imageResponses?: "allow" | "omit" | "auto";
63+
imageResponses?: 'allow' | 'omit' | 'auto';
6464
};
6565

6666
/**
6767
* Modal state types for handling dialogs and file choosers
6868
*/
6969
export type FileUploadModalState = {
70-
type: "fileChooser";
70+
type: 'fileChooser';
7171
description: string;
7272
fileChooser: playwright.FileChooser;
7373
};
7474

7575
export type DialogModalState = {
76-
type: "dialog";
76+
type: 'dialog';
7777
description: string;
7878
dialog: playwright.Dialog;
7979
};
@@ -107,7 +107,7 @@ export type ToolSchema<Input = any> = {
107107
title: string;
108108
description: string;
109109
inputSchema: Input;
110-
type: "readOnly" | "destructive";
110+
type: 'readOnly' | 'destructive';
111111
};
112112

113113
/**
@@ -116,7 +116,7 @@ export type ToolSchema<Input = any> = {
116116
export type Tool<Input = any> = {
117117
capability: ToolCapability;
118118
schema: ToolSchema<Input>;
119-
clearsModalState?: ModalState["type"];
119+
clearsModalState?: ModalState['type'];
120120
handle: (context: Context, params: any) => Promise<ToolResult>;
121121
};
122122

index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
* limitations under the License.
1616
*/
1717

18-
import type { Server } from "@modelcontextprotocol/sdk/server/index.js";
19-
import type { Config } from "./config.js";
20-
import type { BrowserContext } from "playwright";
21-
import type { Context } from "./context.js";
22-
import type { Tab } from "./tab.js";
18+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
19+
import type { Config } from './config.js';
20+
import type { BrowserContext } from 'playwright';
21+
import type { Context } from './context.js';
22+
import type { Tab } from './tab.js';
2323

2424
export type Connection = {
2525
server: Server;

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"license": "Apache-2.0",
1919
"scripts": {
2020
"build": "tsc",
21-
"lint": "npm run update-readme && eslint . && tsc --noEmit",
21+
"lint": "npm run update-readme && eslint . --fix && tsc --noEmit",
2222
"update-readme": "node utils/update-readme.js",
2323
"watch": "tsc --watch",
2424
"test": "playwright test",

src/cdpRelay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export async function startCDPRelayServer(httpServer: http.Server) {
292292
const wsAddress = httpAddressToString(httpServer.address()).replace(/^http/, 'ws');
293293
const cdpRelayServer = new CDPRelayServer(httpServer);
294294
process.on('exit', () => cdpRelayServer.stop());
295-
// eslint-disable-next-line no-console
295+
296296
console.error(`CDP relay server started on ${wsAddress}${EXTENSION_PATH} - Connect to it using the browser extension.`);
297297
const cdpEndpoint = `${wsAddress}${CDP_PATH}`;
298298
return cdpEndpoint;

0 commit comments

Comments
 (0)