Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anxuanzi/bua
/ functions
Functions
249 in github.com/anxuanzi/bua
⨍
Functions
249
◇
Types & classes
95
↓ 1 callers
Method
GetBoundingBox
()
screenshot/screenshot.go:34
↓ 1 callers
Method
GetBoundingBox
()
dom/element.go:199
↓ 1 callers
Method
GetHeight
()
screenshot/screenshot.go:24
↓ 1 callers
Method
GetHistory
GetHistory returns the agent's execution history.
agent/agent.go:467
↓ 1 callers
Method
GetIndex
()
screenshot/screenshot.go:30
↓ 1 callers
Method
GetIndex
()
dom/element.go:195
↓ 1 callers
Method
GetIsEmpty
()
screenshot/screenshot.go:25
↓ 1 callers
Method
GetIsVisible
()
screenshot/screenshot.go:35
↓ 1 callers
Method
GetIsVisible
()
dom/element.go:200
↓ 1 callers
Method
GetRole
()
screenshot/screenshot.go:32
↓ 1 callers
Method
GetRole
()
dom/element.go:197
↓ 1 callers
Method
GetSystemPrompt
GetSystemPrompt returns the system prompt.
agent/message.go:49
↓ 1 callers
Method
GetTagName
()
screenshot/screenshot.go:31
↓ 1 callers
Method
GetTagName
()
dom/element.go:196
↓ 1 callers
Method
GetText
()
screenshot/screenshot.go:33
↓ 1 callers
Method
GetText
()
dom/element.go:198
↓ 1 callers
Method
GetURL
GetURL returns the current page URL.
bua.go:185
↓ 1 callers
Method
GoBack
GoBack navigates back in history.
browser/page.go:48
↓ 1 callers
Method
GoForward
GoForward navigates forward in history.
browser/page.go:67
↓ 1 callers
Method
Hover
Hover moves the mouse to hover over an element.
browser/page.go:512
↓ 1 callers
Method
IsEmpty
IsEmpty returns true if the bounding box has no area.
dom/element.go:24
↓ 1 callers
Function
NewAgentHistory
NewAgentHistory creates a new agent history manager.
agent/history.go:33
↓ 1 callers
Function
NewBrowserAgent
NewBrowserAgent creates a new browser agent using ADK.
agent/agent.go:82
↓ 1 callers
Function
NewBrowserToolkit
NewBrowserToolkit creates a new browser toolkit.
agent/adk_tools.go:20
↓ 1 callers
Function
NewElementMap
NewElementMap creates a new empty element map.
dom/element.go:159
↓ 1 callers
Function
NewMessageManager
NewMessageManager creates a new message manager.
agent/message.go:28
↓ 1 callers
Function
NewSensitiveDataFilter
NewSensitiveDataFilter creates a new sensitive data filter.
agent/message.go:186
↓ 1 callers
Method
Reload
Reload reloads the current page.
browser/page.go:86
↓ 1 callers
Method
ScreenshotAfterActionWithAnnotations
ScreenshotAfterActionWithAnnotations captures an annotated screenshot after an action.
browser/page.go:728
↓ 1 callers
Method
Scroll
Scroll scrolls the page or an element.
browser/page.go:391
↓ 1 callers
Method
ScrollToElement
ScrollToElement scrolls an element into view.
browser/page.go:451
↓ 1 callers
Method
SendKeys
SendKeys sends keyboard keys to the page.
browser/page.go:351
↓ 1 callers
Method
SetTask
SetTask sets the task description for context.
agent/history.go:44
↓ 1 callers
Method
SwitchTab
SwitchTab switches to a different tab by ID.
bua.go:227
↓ 1 callers
Function
SystemPrompt
SystemPrompt returns the system prompt for the browser agent. Ported and adapted from browser-use Python project.
agent/prompts.go:10
↓ 1 callers
Method
ToDescription
ToDescription generates a text description of the history for the LLM. It implements truncation: keeps first item + most recent items within maxItems.
agent/history.go:98
↓ 1 callers
Method
ToTokenString
ToTokenString serializes the element map for LLM consumption. Uses a compact format to minimize token usage.
dom/serialize.go:36
↓ 1 callers
Method
TypeText
TypeText types text into an element by index.
browser/page.go:220
↓ 1 callers
Method
UpdateLastItem
UpdateLastItem updates the result and success status of the last history item.
agent/history.go:72
↓ 1 callers
Method
applyDefaults
applyDefaults fills in default values for the config.
config.go:158
↓ 1 callers
Method
captureScreenshotAfterAction
captureScreenshotAfterAction captures a screenshot after an action has completed. Uses enhanced waiting for page stability after the action.
agent/agent.go:540
↓ 1 callers
Function
drawBoundingBoxFromInfo
drawBoundingBoxFromInfo draws a rectangle border around the bounding box using the interface.
screenshot/annotate.go:133
↓ 1 callers
Function
drawDigit
drawDigit draws a single digit using a simple 5x7 pixel pattern.
screenshot/annotate.go:226
↓ 1 callers
Function
drawIndexLabelFromInfo
drawIndexLabelFromInfo draws the element index at the top center of the bounding box using the interface. Uses a simple built-in digit renderer for mi
screenshot/annotate.go:177
↓ 1 callers
Function
findTestFiles
(tasksDir, category string)
tests/e2e/run_tests.go:152
↓ 1 callers
Function
formatElement
formatElement formats a single element as a compact string.
dom/serialize.go:76
↓ 1 callers
Function
getElementColorFromInfo
getElementColorFromInfo returns the appropriate color for an element type using the interface.
screenshot/annotate.go:110
↓ 1 callers
Function
isImplicitRole
isImplicitRole returns true if the role is implied by the tag.
dom/serialize.go:141
↓ 1 callers
Function
jsonMarshal
jsonMarshal wraps json.Marshal.
dom/serialize.go:203
↓ 1 callers
Function
loadTests
(files []string, testName string)
tests/e2e/run_tests.go:166
↓ 1 callers
Function
parseFlags
()
tests/e2e/run_tests.go:113
↓ 1 callers
Function
printResults
(results []TestResult, verbose bool)
tests/e2e/run_tests.go:322
↓ 1 callers
Function
runSingleTest
(test TestCase, cfg Config)
tests/e2e/run_tests.go:210
↓ 1 callers
Function
runTests
(tests []TestCase, cfg Config)
tests/e2e/run_tests.go:190
↓ 1 callers
Function
truncate
truncate truncates a string to maxLen characters.
examples/01_quick_start/main.go:80
↓ 1 callers
Method
validate
validate checks that required configuration is provided.
config.go:215
↓ 1 callers
Function
validateExpectations
(exp Expectations, result *bua.Result, finalURL string)
tests/e2e/run_tests.go:287
↓ 1 callers
Function
waitForPageReady
waitForPageReady waits for the page to be ready for screenshot.
screenshot/screenshot.go:219
Method
AddPattern
AddPattern adds a custom sensitive data pattern.
agent/message.go:213
Function
AnnotateBrowserUseStyle
AnnotateBrowserUseStyle annotates following browser-use pattern: Only show index labels for elements without text information.
screenshot/annotate.go:296
Function
AnnotateForLLM
AnnotateForLLM annotates a screenshot optimized for LLM vision consumption. Uses default annotation config with appropriate sizing.
screenshot/annotate.go:287
Method
Available
Available returns tokens available after subtracting used tokens.
agent/token.go:138
Function
BuildContinuationPrompt
BuildContinuationPrompt creates a prompt for continuing after an action.
agent/prompts.go:159
Method
BuildErrorRecoveryMessage
BuildErrorRecoveryMessage builds a message for recovering from an error.
agent/message.go:149
Function
CaptureAfterAction
CaptureAfterAction captures a screenshot after an action has been performed. It waits for the page to stabilize after the action before capturing.
screenshot/screenshot.go:463
Function
CaptureAfterActionWithAnnotations
CaptureAfterActionWithAnnotations captures an annotated screenshot after an action.
screenshot/screenshot.go:549
Function
CaptureElement
CaptureElement takes a screenshot of a specific element.
screenshot/screenshot.go:366
Function
CaptureFullPage
CaptureFullPage takes a screenshot of the entire page.
screenshot/screenshot.go:424
Function
CaptureViewport
CaptureViewport takes a screenshot of the current viewport only.
screenshot/screenshot.go:418
Method
Clear
Clear removes all elements.
dom/element.go:227
Method
Clear
Clear resets the message manager state.
agent/message.go:176
Method
ClickAt
ClickAt clicks at specific coordinates.
browser/page.go:162
Method
Close
Close cleans up the agent resources.
agent/agent.go:472
Method
CloseTab
CloseTab closes a tab by ID.
browser/browser.go:408
Function
DefaultConfig
DefaultConfig returns a default browser configuration.
browser/browser.go:52
Function
DefaultOptions
DefaultOptions returns sensible defaults for LLM consumption.
screenshot/screenshot.go:85
Method
EstimateFromElements
EstimateFromElements estimates tokens for element descriptions. Elements have a predictable format so we can be more precise.
agent/token.go:77
Function
ExtractElementMap
ExtractElementMap is a convenience function for extracting elements.
dom/extract.go:206
Method
FindBySelector
FindBySelector returns the first element matching the selector.
dom/element.go:236
Method
FindByText
FindByText returns elements containing the given text.
dom/element.go:249
Function
ForLLM
ForLLM captures a screenshot optimized for LLM consumption. Uses JPEG format with reasonable compression for token efficiency. Includes page readiness
screenshot/screenshot.go:432
Function
ForLLMSafe
ForLLMSafe captures a screenshot for LLM consumption with full validation. Returns nil data (not error) if page is blank or screenshot is empty. This
screenshot/screenshot.go:443
Function
ForLLMSafeWithAnnotations
ForLLMSafeWithAnnotations captures an annotated screenshot, returning nil for blank pages.
screenshot/screenshot.go:530
Function
ForLLMWithAnnotations
ForLLMWithAnnotations captures an annotated screenshot optimized for LLM vision. Includes bounding boxes around interactive elements with index labels
screenshot/screenshot.go:521
Method
GetBoundingBox
()
browser/page.go:700
Method
GetBoundingBox
GetBoundingBox implements ElementInfo interface for screenshot annotations. Returns a BoundingBoxInfoInterface that wraps the BoundingBox.
dom/element.go:134
Method
GetCurrentMemory
GetCurrentMemory returns the accumulated memory from history.
agent/history.go:81
Method
GetElements
GetElements returns elements as screenshot.ElementInfo slice.
browser/page.go:678
Method
GetElements
GetElements returns all elements as ElementInfoInterface for screenshot annotations. This implements ElementMapInterface from the screenshot package.
dom/element.go:215
Method
GetHeight
GetHeight implements BoundingBoxInfo interface.
dom/element.go:38
Method
GetHeight
()
dom/element.go:209
Method
GetHistory
GetHistory returns the agent history.
agent/message.go:64
Method
GetIndex
()
browser/page.go:695
Method
GetIndex
GetIndex implements ElementInfo interface for screenshot annotations.
dom/element.go:121
Method
GetIsEmpty
GetIsEmpty implements BoundingBoxInfo interface.
dom/element.go:41
Method
GetIsEmpty
()
dom/element.go:210
Method
GetIsVisible
()
browser/page.go:699
Method
GetIsVisible
GetIsVisible implements ElementInfo interface for screenshot annotations.
dom/element.go:139
Method
GetItems
GetItems returns all history items.
agent/history.go:59
Method
GetLastItem
GetLastItem returns the most recent history item, or nil if empty.
agent/history.go:64
← previous
next →
101–200 of 249, ranked by callers