Skip to content

Commit ead6dd2

Browse files
committed
stagehand migration v1
1 parent b81ffe5 commit ead6dd2

File tree

15 files changed

+1202
-355
lines changed

15 files changed

+1202
-355
lines changed

stagehand/cli.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
import './dist/program.js';

stagehand/config.d.ts

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import type { Cookie } from "playwright-core";
2+
3+
export type Config = {
4+
/**
5+
* The Browserbase API Key to use
6+
*/
7+
browserbaseApiKey?: string;
8+
/**
9+
* The Browserbase Project ID to use
10+
*/
11+
browserbaseProjectId?: string;
12+
/**
13+
* Whether or not to use Browserbase proxies
14+
* https://docs.browserbase.com/features/proxies
15+
*
16+
* @default false
17+
*/
18+
proxies?: boolean;
19+
/**
20+
* Use advanced stealth mode. Only available to Browserbase Scale Plan users.
21+
*
22+
* @default false
23+
*/
24+
advancedStealth?: boolean;
25+
/**
26+
* Potential Browserbase Context to use
27+
* Would be a context ID
28+
*/
29+
context?: {
30+
/**
31+
* The ID of the context to use
32+
*/
33+
contextId?: string;
34+
/**
35+
* Whether or not to persist the context
36+
*
37+
* @default true
38+
*/
39+
persist?: boolean;
40+
};
41+
/**
42+
*
43+
*/
44+
viewPort?: {
45+
/**
46+
* The width of the browser
47+
*/
48+
browserWidth?: number;
49+
/**
50+
* The height of the browser
51+
*/
52+
browserHeight?: number;
53+
};
54+
/**
55+
* Cookies to inject into the Browserbase context
56+
* Format: Array of cookie objects with name, value, domain, and optional path, expires, httpOnly, secure, sameSite
57+
*/
58+
cookies?: Cookie[];
59+
/**
60+
* Whether or not to port to a server
61+
*
62+
*/
63+
server?: {
64+
/**
65+
* The port to listen on for SSE or MCP transport.
66+
*/
67+
port?: number;
68+
/**
69+
* The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
70+
*/
71+
host?: string;
72+
};
73+
tools?: {
74+
/**
75+
* Configuration for the browser_take_screenshot tool.
76+
*/
77+
browserbase_take_screenshot?: {
78+
/**
79+
* Whether to disable base64-encoded image responses to the clients that
80+
* don't support binary data or prefer to save on tokens.
81+
*/
82+
omitBase64?: boolean;
83+
}
84+
}
85+
};

stagehand/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
2+
3+
import type { Config } from './config';
4+
5+
export declare function createServer(config?: Config): Promise<Server>;
6+
export {};

stagehand/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { createServer } from './dist/index.js';
2+
export default { createServer };

stagehand/package-lock.json

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

stagehand/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"dependencies": {
2222
"@browserbasehq/sdk": "^2.0.0",
2323
"@browserbasehq/stagehand": "^2.0.0",
24-
"@modelcontextprotocol/sdk": "^1.0.3",
25-
"@modelcontextprotocol/server-stagehand": "file:",
26-
"@playwright/test": "^1.49.0"
24+
"@modelcontextprotocol/sdk": "^1.13.0",
25+
"@playwright/test": "^1.49.0",
26+
"commander": "^14.0.0"
2727
},
2828
"devDependencies": {
2929
"shx": "^0.3.4",

0 commit comments

Comments
 (0)