Skip to content

Commit 1fc8326

Browse files
committed
changing config for build
1 parent 7adf35f commit 1fc8326

File tree

5 files changed

+18
-23
lines changed

5 files changed

+18
-23
lines changed

config.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ import type { Cookie } from "playwright-core";
22
import type { AvailableModelSchema } from "@browserbasehq/stagehand";
33

44
export type Config = {
5+
/**
6+
* Browserbase API Key to authenticate requests
7+
*/
8+
browserbaseApiKey: string;
9+
/**
10+
* Browserbase Project ID associated with the API key
11+
*/
12+
browserbaseProjectId: string;
513
/**
614
* Whether or not to use Browserbase proxies
715
* https://docs.browserbase.com/features/proxies

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"dependencies": {
4141
"@browserbasehq/stagehand": "^2.4.0",
4242
"@modelcontextprotocol/sdk": "^1.13.1",
43-
"@playwright/test": "^1.49.0",
4443
"@smithery/cli": "^1.2.15",
4544
"commander": "^14.0.0",
4645
"dotenv": "^16.4.6",

pnpm-lock.yaml

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

src/config.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export type ToolCapability = "core" | string;
66

77
// Define Command Line Options Structure
88
export type CLIOptions = {
9-
browserbaseApiKey?: string;
10-
browserbaseProjectId?: string;
119
proxies?: boolean;
1210
advancedStealth?: boolean;
1311
contextId?: string;
@@ -23,6 +21,8 @@ export type CLIOptions = {
2321

2422
// Default Configuration Values
2523
const defaultConfig: Config = {
24+
browserbaseApiKey: process.env.BROWSERBASE_API_KEY ?? "",
25+
browserbaseProjectId: process.env.BROWSERBASE_PROJECT_ID ?? "",
2626
proxies: false,
2727
server: {
2828
port: undefined,
@@ -50,18 +50,19 @@ export async function resolveConfig(cliOptions: CLIOptions): Promise<Config> {
5050
// --------------------------------
5151

5252
// Basic validation for Browserbase keys - provide dummy values if not set
53-
if (!cliOptions.browserbaseApiKey) {
53+
if (!mergedConfig.browserbaseApiKey) {
5454
console.warn(
5555
"Warning: BROWSERBASE_API_KEY environment variable not set. Using dummy value.",
5656
);
57-
cliOptions.browserbaseApiKey = "dummy-browserbase-api-key";
57+
mergedConfig.browserbaseApiKey = "dummy-browserbase-api-key";
5858
}
59-
if (!cliOptions.browserbaseProjectId) {
59+
if (!mergedConfig.browserbaseProjectId) {
6060
console.warn(
6161
"Warning: BROWSERBASE_PROJECT_ID environment variable not set. Using dummy value.",
6262
);
63-
cliOptions.browserbaseProjectId = "dummy-browserbase-project-id";
63+
mergedConfig.browserbaseProjectId = "dummy-browserbase-project-id";
6464
}
65+
6566
if (!mergedConfig.modelApiKey) {
6667
console.warn(
6768
"Warning: MODEL_API_KEY environment variable not set. Using dummy value.",
@@ -77,6 +78,8 @@ export async function configFromCLIOptions(
7778
cliOptions: CLIOptions,
7879
): Promise<Config> {
7980
return {
81+
browserbaseApiKey: process.env.BROWSERBASE_API_KEY ?? "",
82+
browserbaseProjectId: process.env.BROWSERBASE_PROJECT_ID ?? "",
8083
server: {
8184
port: cliOptions.port,
8285
host: cliOptions.host,

src/program.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ program
6969
const config = await resolveConfig(options);
7070
const serverList = new ServerList(async () =>
7171
createServerFunction({
72-
config: config as Required<
73-
Pick<typeof config, "browserbaseApiKey" | "browserbaseProjectId">
74-
> &
75-
typeof config,
72+
config: config,
7673
}),
7774
);
7875
setupExitWatchdog(serverList);

0 commit comments

Comments
 (0)