Skip to content

Commit ed0d98e

Browse files
authored
add exp flag and add keepalive to cli options (#109)
* add exp flag and add keepalive to cli options * bump stagehand in pnpm lock
1 parent 769b881 commit ed0d98e

File tree

9 files changed

+434
-412
lines changed

9 files changed

+434
-412
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ The Browserbase MCP server accepts the following command-line flags:
150150
| `--browserHeight <height>` | Browser viewport height (default: 768) |
151151
| `--modelName <model>` | The model to use for Stagehand (default: google/gemini-2.0-flash) |
152152
| `--modelApiKey <key>` | API key for the custom model provider (required when using custom models) |
153+
| `--experimental` | Enable experimental features (default: false) |
153154

154155
These flags can be passed directly to the CLI or configured in your MCP configuration file.
155156

config.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,10 @@ export type Config = {
104104
* Required when using a model other than the default google/gemini-2.0-flash
105105
*/
106106
modelApiKey?: string;
107+
/**
108+
* Enable experimental features
109+
*
110+
* @default false
111+
*/
112+
experimental?: boolean;
107113
};

package-lock.json

Lines changed: 414 additions & 410 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
@@ -42,7 +42,7 @@
4242
},
4343
"dependencies": {
4444
"@browserbasehq/sdk": "^2.6.0",
45-
"@browserbasehq/stagehand": "^2.4.0",
45+
"@browserbasehq/stagehand": "^2.4.3",
4646
"@modelcontextprotocol/sdk": "^1.13.1",
4747
"@smithery/cli": "^1.2.15",
4848
"commander": "^14.0.0",

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export type CLIOptions = {
1717
browserHeight?: number;
1818
modelName?: typeof AvailableModel;
1919
modelApiKey?: string;
20+
keepAlive?: boolean;
21+
experimental?: boolean;
2022
};
2123

2224
// Default Configuration Values
@@ -97,6 +99,8 @@ export async function configFromCLIOptions(
9799
cookies: cliOptions.cookies,
98100
modelName: cliOptions.modelName,
99101
modelApiKey: cliOptions.modelApiKey,
102+
keepAlive: cliOptions.keepAlive,
103+
experimental: cliOptions.experimental,
100104
};
101105
}
102106

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ export const configSchema = z
103103
.describe(
104104
"API key for the custom model provider. Required when using a model other than the default google/gemini-2.0-flash",
105105
),
106+
experimental: z
107+
.boolean()
108+
.optional()
109+
.describe("Enable experimental Stagehand features"),
106110
})
107111
.refine(
108112
(data) => {

src/program.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ program
6565
"--modelApiKey <key>",
6666
"API key for the custom model provider (required when using custom models)",
6767
)
68+
.option("--keepAlive", "Enable Browserbase Keep Alive Session")
69+
.option("--experimental", "Enable experimental features")
6870
.action(async (options) => {
6971
const config = await resolveConfig(options);
7072
const serverList = new ServerList(async () =>

src/stagehandStore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const createStagehandInstance = async (
3333
...(params.browserbaseSessionID && {
3434
browserbaseSessionID: params.browserbaseSessionID,
3535
}),
36+
experimental: config.experimental ?? false,
3637
browserbaseSessionCreateParams: {
3738
projectId,
3839
proxies: config.proxies,

0 commit comments

Comments
 (0)