Skip to content

Commit e50969b

Browse files
committed
cleanup tools
1 parent 459b3ad commit e50969b

File tree

10 files changed

+1
-34
lines changed

10 files changed

+1
-34
lines changed

stagehand/config.d.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,4 @@ export type Config = {
7070
*/
7171
host?: string;
7272
};
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-
}
8573
};

stagehand/src/config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export async function resolveConfig(cliOptions: CLIOptions): Promise<Config> {
4545
const mergedConfig = mergeConfig(defaultConfig, cliConfig);
4646

4747
// --- Add Browserbase Env Vars ---
48-
// Ensure env vars are read *after* dotenv potentially runs (in index.ts)
4948
if (!mergedConfig.browserbaseApiKey) {
5049
mergedConfig.browserbaseApiKey = process.env.BROWSERBASE_API_KEY;
5150
}

stagehand/src/tools/act.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ async function handleAct(
5858

5959
return {
6060
action,
61-
captureSnapshot: false,
62-
code: [],
6361
waitForNetwork: false,
6462
};
6563
}

stagehand/src/tools/extract.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ async function handleExtract(
6565

6666
return {
6767
action,
68-
captureSnapshot: false,
69-
code: [],
7068
waitForNetwork: false,
7169
};
7270
}

stagehand/src/tools/navigate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ async function handleNavigate(
4949

5050
return {
5151
action,
52-
captureSnapshot: false,
53-
code: [],
5452
waitForNetwork: false,
5553
};
5654
}

stagehand/src/tools/observe.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ async function handleObserve(
4646

4747
return {
4848
action,
49-
captureSnapshot: false,
50-
code: [],
5149
waitForNetwork: false,
5250
};
5351
}

stagehand/src/tools/screenshot.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ async function handleScreenshot(
6969

7070
return {
7171
action,
72-
captureSnapshot: false,
73-
code: [],
7472
waitForNetwork: false,
7573
};
7674
}

stagehand/src/tools/session.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ async function handleCreateSession(
9898
// Return the ToolResult structure expected by Context.run
9999
return {
100100
action: action,
101-
captureSnapshot: false,
102-
code: [],
103101
waitForNetwork: false,
104102
};
105103
}
@@ -131,8 +129,6 @@ async function handleCloseSession(
131129
context: Context,
132130
_params: CloseSessionInput
133131
): Promise<ToolResult> {
134-
const code = [`// Attempting to close the current Browserbase session.`];
135-
136132
const action = async (): Promise<ToolActionResult> => {
137133
// Store the current session ID before it's potentially changed.
138134
// This allows us to reference the original session ID later if needed.
@@ -217,8 +213,6 @@ async function handleCloseSession(
217213

218214
return {
219215
action: action,
220-
code: code,
221-
captureSnapshot: false,
222216
waitForNetwork: false,
223217
};
224218
}

stagehand/src/tools/tool.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ export type InputType = z.Schema;
1717
export type ToolActionResult = { content?: (ImageContent | TextContent)[] } | undefined | void;
1818

1919
export type ToolResult = {
20-
code: string[];
2120
action?: () => Promise<ToolActionResult>;
22-
captureSnapshot: boolean;
2321
waitForNetwork: boolean;
24-
resultOverride?: ToolActionResult;
2522
};
2623

2724
export type Tool<Input extends InputType = InputType> = {

stagehand/src/transport.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ async function handleSSE(req: http.IncomingMessage, res: http.ServerResponse, ur
3434
res.on('close', () => {
3535
sessions.delete(transport.sessionId);
3636
serverList.close(server).catch(e => {
37-
// eslint-disable-next-line no-console
38-
// console.error(e);
37+
console.error(e);
3938
});
4039
});
4140
return await server.connect(transport);

0 commit comments

Comments
 (0)