MCPcopy Create free account

hub / github.com/anxuanzi/bua / functions

Functions249 in github.com/anxuanzi/bua

↓ 29 callersMethodActivePage
ActivePage returns the currently active page.
browser/browser.go:287
↓ 17 callersMethodRefreshElementMap
RefreshElementMap updates the cached element map.
agent/adk_tools.go:28
↓ 10 callersMethodWaitStable
WaitStable waits for the page to become stable.
browser/browser.go:455
↓ 8 callersMethodGet
Get returns an element by index.
dom/element.go:176
↓ 7 callersMethodClick
Click clicks on an element by index.
browser/page.go:105
↓ 6 callersFunctionCapture
Capture takes a screenshot of the page and returns compressed bytes. It implements proper page readiness checks following browser-use best practices.
screenshot/screenshot.go:117
↓ 6 callersMethodCenter
Center returns the center point of the bounding box.
dom/element.go:14
↓ 5 callersFunctionDefaultAnnotationConfig
DefaultAnnotationConfig returns sensible defaults for annotations.
screenshot/annotate.go:38
↓ 5 callersMethodGetElementMap
GetElementMap returns the current element map.
agent/adk_tools.go:38
↓ 5 callersMethodLen
()
screenshot/screenshot.go:41
↓ 5 callersMethodNavigate
Navigate opens a URL in the browser. This is a convenience method for direct navigation without a task.
bua.go:139
↓ 5 callersMethodhighlightElement
highlightElement shows a visual highlight on an element.
browser/page.go:482
↓ 5 callersFunctionhumanDelay
humanDelay adds a random human-like delay.
browser/stealth.go:255
↓ 4 callersMethodClose
Close shuts down the browser and cleans up resources.
bua.go:152
↓ 4 callersMethodGetY
()
screenshot/screenshot.go:22
↓ 4 callersFunctionLLMOptions
LLMOptions returns options optimized for LLM vision consumption. Includes page readiness checks and content validation.
screenshot/screenshot.go:101
↓ 4 callersMethodToTokenStringLimited
ToTokenStringLimited is a convenience method with a max elements limit.
dom/serialize.go:69
↓ 4 callersFunctionclamp
clamp restricts a value to be within min and max.
screenshot/annotate.go:275
↓ 3 callersFunctionAnnotate
Annotate draws bounding boxes and labels on a screenshot image. Following browser-use pattern: boxes around interactive elements with index labels.
screenshot/annotate.go:55
↓ 3 callersFunctionBuildPageStatePrompt
BuildPageStatePrompt creates a prompt describing the current page state.
agent/prompts.go:134
↓ 3 callersFunctionCaptureWithAnnotations
CaptureWithAnnotations captures a screenshot and draws element annotations. This follows browser-use pattern: bounding boxes around interactive elemen
screenshot/screenshot.go:497
↓ 3 callersFunctionDefaultAnnotatedOptions
DefaultAnnotatedOptions returns options with annotations enabled.
screenshot/screenshot.go:486
↓ 3 callersMethodDescription
Description returns a human-readable description of the element.
dom/element.go:98
↓ 3 callersMethodGetX
()
screenshot/screenshot.go:21
↓ 3 callersFunctionNewElementMapAdapter
NewElementMapAdapter creates an adapter for annotation.
browser/page.go:665
↓ 3 callersFunctionNewExtractor
NewExtractor creates a new DOM extractor.
dom/extract.go:158
↓ 3 callersMethodRun
Run executes a task described in natural language. Returns a Result containing the outcome and execution details.
bua.go:94
↓ 3 callersMethodScreenshot
Screenshot takes a screenshot of the current page. Uses the enhanced screenshot package with proper page readiness checks.
browser/page.go:559
↓ 3 callersMethodScreenshotSafe
ScreenshotSafe takes a screenshot, returning nil (not error) for blank pages. This is useful for agent loops where blank screenshots should be skipped
browser/page.go:574
↓ 3 callersMethodScreenshotSafeWithAnnotations
ScreenshotSafeWithAnnotations takes an annotated screenshot, returning nil for blank pages.
browser/page.go:717
↓ 3 callersMethodStart
Start launches the browser and initializes the agent.
bua.go:37
↓ 3 callersFunctioncontainsIgnoreCase
containsIgnoreCase checks if s contains substr (case-insensitive).
dom/element.go:265
↓ 3 callersFunctionisBlankPage
isBlankPage checks if the page is a blank page (about:blank or empty).
screenshot/screenshot.go:204
↓ 2 callersMethodAdd
Add adds an element to the map.
dom/element.go:167
↓ 2 callersMethodContains
Contains checks if a point is within the bounding box.
dom/element.go:19
↓ 2 callersMethodExtract
Extract extracts interactive elements from the page.
dom/extract.go:166
↓ 2 callersMethodFilterSensitiveData
FilterSensitiveData filters sensitive data from a message.
agent/message.go:171
↓ 2 callersMethodGetConsecutiveFailures
GetConsecutiveFailures returns the number of consecutive failures at the end.
agent/history.go:184
↓ 2 callersMethodGetElementMap
GetElementMap extracts interactive elements from the current page.
browser/browser.go:440
↓ 2 callersMethodGetElements
()
screenshot/screenshot.go:42
↓ 2 callersMethodGetWidth
()
screenshot/screenshot.go:23
↓ 2 callersFunctionIsPageReady
IsPageReady checks if the page is ready for screenshot capture.
screenshot/screenshot.go:295
↓ 2 callersMethodListTabs
ListTabs returns information about all open tabs.
bua.go:253
↓ 2 callersFunctionNew
New creates a new browser automation agent. Call Start() before using Run().
bua.go:24
↓ 2 callersFunctionNew
New creates a new browser instance.
browser/browser.go:91
↓ 2 callersMethodNewTab
NewTab opens a new browser tab.
bua.go:214
↓ 2 callersMethodScreenshotAfterAction
ScreenshotAfterAction captures a screenshot after an action completes. Waits for page stability before capturing.
browser/page.go:585
↓ 2 callersMethodStepCount
StepCount returns the number of steps executed.
agent/history.go:86
↓ 2 callersFunctionapplyStealthMode
applyStealthMode injects stealth JavaScript into a page.
browser/stealth.go:195
↓ 2 callersMethodcaptureAndSaveScreenshot
captureAndSaveScreenshot captures a screenshot and saves it to disk if configured. Returns the screenshot bytes and the saved path (empty if not saved
agent/agent.go:480
↓ 2 callersMethodclearInput
clearInput clears the currently focused input.
browser/page.go:330
↓ 2 callersMethodcreateMultimodalContent
createMultimodalContent creates a genai.Content with both text and image.
agent/agent.go:603
↓ 2 callersFunctiongenerateTabID
generateTabID creates a unique 4-character tab ID.
browser/browser.go:465
↓ 2 callersFunctionisEmptyImage
isEmptyImage checks if the image is mostly white/empty. Uses sampling to check a grid of pixels for efficiency.
screenshot/screenshot.go:246
↓ 2 callersFunctionrandomMouseOffset
randomMouseOffset returns a small random offset for more human-like clicking.
browser/stealth.go:272
↓ 2 callersFunctiontoLower
toLower converts ASCII characters to lowercase.
dom/element.go:282
↓ 1 callersMethodAddHistoryItem
AddHistoryItem adds an item to the execution history.
agent/message.go:59
↓ 1 callersMethodAddItem
AddItem adds a new history item.
agent/history.go:49
↓ 1 callersMethodBuildContinuationMessage
BuildContinuationMessage builds a message for continuing after an action.
agent/message.go:132
↓ 1 callersFunctionBuildErrorRecoveryPrompt
BuildErrorRecoveryPrompt creates a prompt for recovering from an error.
agent/prompts.go:177
↓ 1 callersMethodBuildInitialTaskMessage
BuildInitialTaskMessage builds the initial message with task description.
agent/message.go:110
↓ 1 callersMethodBuildStateMessage
BuildStateMessage builds the current state message for the LLM.
agent/message.go:69
↓ 1 callersFunctionBuildTaskPrompt
BuildTaskPrompt creates the initial task prompt.
agent/prompts.go:154
↓ 1 callersMethodClear
Clear resets the history.
agent/history.go:91
↓ 1 callersMethodClearAndType
ClearAndType clears an input and types new text.
browser/page.go:285
↓ 1 callersMethodClose
Close shuts down the browser and cleans up resources.
browser/browser.go:250
↓ 1 callersMethodCloseTab
CloseTab closes a tab by ID.
bua.go:240
↓ 1 callersMethodCreateAllTools
CreateAllTools creates all browser automation tools.
agent/adk_tools.go:777
↓ 1 callersMethodCreateClearAndTypeTool
CreateClearAndTypeTool creates the clear_and_type function tool.
agent/adk_tools.go:393
↓ 1 callersMethodCreateClickTool
CreateClickTool creates the click function tool.
agent/adk_tools.go:354
↓ 1 callersMethodCreateCloseTabTool
CreateCloseTabTool creates the close_tab function tool.
agent/adk_tools.go:694
↓ 1 callersMethodCreateDoneTool
CreateDoneTool creates the done function tool.
agent/adk_tools.go:760
↓ 1 callersMethodCreateDoubleClickTool
CreateDoubleClickTool creates the double_click function tool.
agent/adk_tools.go:504
↓ 1 callersMethodCreateEvaluateJSTool
CreateEvaluateJSTool creates the evaluate_js function tool.
agent/adk_tools.go:619
↓ 1 callersMethodCreateExtractContentTool
CreateExtractContentTool creates the extract_content function tool.
agent/adk_tools.go:580
↓ 1 callersMethodCreateFocusTool
CreateFocusTool creates the focus function tool.
agent/adk_tools.go:524
↓ 1 callersMethodCreateGetPageStateTool
CreateGetPageStateTool creates the get_page_state function tool.
agent/adk_tools.go:734
↓ 1 callersMethodCreateGoBackTool
CreateGoBackTool creates the go_back function tool.
agent/adk_tools.go:450
↓ 1 callersMethodCreateGoForwardTool
CreateGoForwardTool creates the go_forward function tool.
agent/adk_tools.go:467
↓ 1 callersMethodCreateHoverTool
CreateHoverTool creates the hover function tool.
agent/adk_tools.go:484
↓ 1 callersMethodCreateListTabsTool
CreateListTabsTool creates the list_tabs function tool.
agent/adk_tools.go:711
↓ 1 callersMethodCreateNavigateTool
---- Tool Functions ---- CreateNavigateTool creates the navigate function tool.
agent/adk_tools.go:337
↓ 1 callersMethodCreateNewTabTool
CreateNewTabTool creates the new_tab function tool.
agent/adk_tools.go:659
↓ 1 callersMethodCreateReloadTool
CreateReloadTool creates the reload function tool.
agent/adk_tools.go:543
↓ 1 callersMethodCreateScreenshotTool
CreateScreenshotTool creates the screenshot function tool.
agent/adk_tools.go:601
↓ 1 callersMethodCreateScrollToElementTool
CreateScrollToElementTool creates the scroll_to_element function tool.
agent/adk_tools.go:560
↓ 1 callersMethodCreateScrollTool
CreateScrollTool creates the scroll function tool.
agent/adk_tools.go:412
↓ 1 callersMethodCreateSendKeysTool
CreateSendKeysTool creates the send_keys function tool.
agent/adk_tools.go:433
↓ 1 callersMethodCreateSwitchTabTool
CreateSwitchTabTool creates the switch_tab function tool.
agent/adk_tools.go:677
↓ 1 callersMethodCreateTypeTextTool
CreateTypeTextTool creates the type_text function tool.
agent/adk_tools.go:374
↓ 1 callersMethodCreateWaitTool
CreateWaitTool creates the wait function tool.
agent/adk_tools.go:636
↓ 1 callersFunctionDefaultSerializeOptions
DefaultSerializeOptions returns sensible defaults.
dom/serialize.go:25
↓ 1 callersFunctionDefaultStealthConfig
DefaultStealthConfig returns sensible stealth defaults.
browser/stealth.go:44
↓ 1 callersFunctionDefaultViewport
DefaultViewport returns the default viewport size.
config.go:35
↓ 1 callersMethodDoubleClick
DoubleClick double-clicks on an element by index.
browser/page.go:188
↓ 1 callersMethodEstimateTokens
EstimateTokens estimates the number of tokens in a text string. This uses a simple character-based heuristic: - ~4 characters per token for English te
agent/token.go:26
↓ 1 callersMethodEvaluateJS
EvaluateJS evaluates JavaScript code on the page.
browser/page.go:639
↓ 1 callersMethodExtractContent
ExtractContent extracts text content from the page.
browser/page.go:615
↓ 1 callersMethodFilter
Filter replaces sensitive data with placeholders.
agent/message.go:200
↓ 1 callersMethodFocus
Focus focuses on an element.
browser/page.go:534
next →1–100 of 249, ranked by callers