Documentation
¶
Overview ¶
Package browser registers chat-agent browser_* tools backed by pkg/agent/browser.
Index ¶
Constants ¶
const ( ToolSnapshot = "browser_snapshot" ToolClick = "browser_click" ToolType = "browser_type" ToolScroll = "browser_scroll" ToolWait = "browser_wait" ToolScreenshot = "browser_screenshot" )
Variables ¶
This section is empty.
Functions ¶
func ActiveToolNames ¶
func ActiveToolNames() []string
ActiveToolNames returns browser tool names when registered.
Types ¶
type ClickTool ¶
type ClickTool struct{}
ClickTool clicks a snapshot ref.
func (ClickTool) Description ¶
Description explains the tool to the model.
func (ClickTool) Execute ¶
func (ClickTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute clicks the ref.
func (ClickTool) Parameters ¶
Parameters returns the JSON schema for tool arguments.
type NavigateTool ¶
type NavigateTool struct{}
NavigateTool loads a URL in the run browser context.
func (NavigateTool) Description ¶
func (NavigateTool) Description() string
Description explains the tool to the model.
func (NavigateTool) Execute ¶
func (NavigateTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute navigates to the URL.
func (NavigateTool) Parameters ¶
func (NavigateTool) Parameters() map[string]any
Parameters returns the JSON schema for tool arguments.
type ScreenshotTool ¶
type ScreenshotTool struct{}
ScreenshotTool captures a PNG of the page.
func (ScreenshotTool) Description ¶
func (ScreenshotTool) Description() string
Description explains the tool to the model.
func (ScreenshotTool) Execute ¶
func (ScreenshotTool) Execute(ctx context.Context, id string, _ map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute captures a screenshot as image media plus text metadata.
func (ScreenshotTool) Parameters ¶
func (ScreenshotTool) Parameters() map[string]any
Parameters returns the JSON schema for tool arguments.
type ScrollTool ¶
type ScrollTool struct{}
ScrollTool scrolls the page.
func (ScrollTool) Description ¶
func (ScrollTool) Description() string
Description explains the tool to the model.
func (ScrollTool) Execute ¶
func (ScrollTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute scrolls the page.
func (ScrollTool) Parameters ¶
func (ScrollTool) Parameters() map[string]any
Parameters returns the JSON schema for tool arguments.
type SnapshotTool ¶
type SnapshotTool struct{}
SnapshotTool returns a compact interactive tree with refs.
func (SnapshotTool) Description ¶
func (SnapshotTool) Description() string
Description explains the tool to the model.
func (SnapshotTool) Execute ¶
func (SnapshotTool) Execute(ctx context.Context, id string, _ map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute returns the snapshot text.
func (SnapshotTool) Parameters ¶
func (SnapshotTool) Parameters() map[string]any
Parameters returns the JSON schema for tool arguments.
type TypeTool ¶
type TypeTool struct{}
TypeTool types into a snapshot ref.
func (TypeTool) Description ¶
Description explains the tool to the model.
func (TypeTool) Execute ¶
func (TypeTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute types into the ref.
func (TypeTool) Parameters ¶
Parameters returns the JSON schema for tool arguments.
type WaitTool ¶
type WaitTool struct{}
WaitTool waits for a short duration.
func (WaitTool) Description ¶
Description explains the tool to the model.
func (WaitTool) Execute ¶
func (WaitTool) Execute(ctx context.Context, id string, args map[string]any, _ tool.UpdateHandler) (msg.ToolResultMessage, error)
Execute waits.
func (WaitTool) Parameters ¶
Parameters returns the JSON schema for tool arguments.