Add browser_action tool

This commit is contained in:
Saoud Rizwan
2024-10-27 02:39:41 -04:00
parent 17f34e6225
commit d9f9e7ba16
8 changed files with 576 additions and 268 deletions

View File

@@ -57,6 +57,7 @@ export type ClineAsk =
| "resume_task"
| "resume_completed_task"
| "mistake_limit_reached"
| "browser_action_launch"
export type ClineSay =
| "task"
@@ -71,7 +72,8 @@ export type ClineSay =
| "command_output"
| "tool"
| "shell_integration_warning"
| "inspect_site_result"
| "browser_action"
| "browser_action_result"
export interface ClineSayTool {
tool:
@@ -82,7 +84,6 @@ export interface ClineSayTool {
| "listFilesRecursive"
| "listCodeDefinitionNames"
| "searchFiles"
| "inspectSite"
path?: string
diff?: string
content?: string
@@ -90,6 +91,23 @@ export interface ClineSayTool {
filePattern?: string
}
// must keep in sync with system prompt
export const browserActions = ["launch", "click", "type", "scroll_down", "scroll_up", "close"] as const
export type BrowserAction = (typeof browserActions)[number]
export interface ClineSayBrowserAction {
action: BrowserAction
coordinate?: string
text?: string
}
export type BrowserActionResult = {
screenshot?: string
logs?: string
currentUrl?: string
currentMousePosition?: string
}
export interface ClineApiReqInfo {
request?: string
tokensIn?: number