mcp

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mcp provides an MCP (Model Context Protocol) server for browser automation.

Index

Constants

This section is empty.

Variables

View Source
var ToolNames = struct {
	// Browser
	BrowserLaunch string
	BrowserQuit   string

	// Page - Navigation
	PageNavigate  string
	PageGoBack    string
	PageGoForward string
	PageReload    string
	PageScroll    string

	// Page - State
	PageGetTitle       string
	PageGetURL         string
	PageGetContent     string
	PageSetContent     string
	PageGetViewport    string
	PageSetViewport    string
	PageScreenshot     string
	PagePDF            string
	PageNew            string
	PageGetCount       string
	PageClose          string
	PageBringToFront   string
	PageEmulateMedia   string
	PageSetGeolocation string

	// Element - Interactions
	ElementClick          string
	ElementDoubleClick    string
	ElementType           string
	ElementFill           string
	ElementFillForm       string
	ElementClear          string
	ElementPress          string
	ElementCheck          string
	ElementUncheck        string
	ElementSelect         string
	ElementSetFiles       string
	ElementHover          string
	ElementFocus          string
	ElementScrollIntoView string
	ElementDragTo         string
	ElementTap            string
	ElementDispatchEvent  string
	ElementScreenshot     string
	ElementEvaluate       string

	// Element - State
	ElementGetText        string
	ElementGetValue       string
	ElementGetInnerHTML   string
	ElementGetOuterHTML   string
	ElementGetInnerText   string
	ElementGetAttribute   string
	ElementGetBoundingBox string
	ElementIsVisible      string
	ElementIsHidden       string
	ElementIsEnabled      string
	ElementIsChecked      string
	ElementIsEditable     string
	ElementGetRole        string
	ElementGetLabel       string

	// Input
	InputKeyboardPress string
	InputKeyboardDown  string
	InputKeyboardUp    string
	InputKeyboardType  string
	InputMouseClick    string
	InputMouseMove     string
	InputMouseDown     string
	InputMouseUp       string
	InputMouseWheel    string
	InputMouseDrag     string
	InputTouchTap      string
	InputTouchSwipe    string

	// JavaScript
	JSEvaluate   string
	JSAddScript  string
	JSAddStyle   string
	JSInitScript string

	// HTTP
	HTTPRequest string

	// Batch
	BatchExecute string

	// Wait
	WaitForState    string
	WaitForURL      string
	WaitForLoad     string
	WaitForFunction string
	WaitForSelector string
	WaitForText     string

	// Tab
	TabList   string
	TabSelect string
	TabClose  string

	// Frame
	FrameSelect     string
	FrameSelectMain string

	// Dialog
	DialogHandle string
	DialogGet    string

	// Console
	ConsoleGetMessages string
	ConsoleClear       string

	// Network
	NetworkGetRequests string
	NetworkClear       string
	NetworkRoute       string
	NetworkListRoutes  string
	NetworkUnroute     string
	NetworkSetOffline  string

	// Storage - Cookies
	StorageGetCookies   string
	StorageSetCookies   string
	StorageClearCookies string
	StorageDeleteCookie string

	// Storage - State
	StorageGetState string
	StorageSetState string
	StorageClearAll string

	// Storage - Local
	StorageLocalGet    string
	StorageLocalSet    string
	StorageLocalDelete string
	StorageLocalClear  string
	StorageLocalList   string

	// Storage - Session
	StorageSessionGet    string
	StorageSessionSet    string
	StorageSessionDelete string
	StorageSessionClear  string
	StorageSessionList   string

	// Trace
	TraceStart      string
	TraceStop       string
	TraceChunkStart string
	TraceChunkStop  string
	TraceGroupStart string
	TraceGroupStop  string

	// Record
	RecordStart  string
	RecordStop   string
	RecordExport string
	RecordStatus string
	RecordClear  string

	// Test - Assertions
	TestAssertText    string
	TestAssertElement string
	TestAssertURL     string

	// Test - Verification
	TestVerifyValue     string
	TestVerifyList      string
	TestVerifyText      string
	TestVerifyVisible   string
	TestVerifyEnabled   string
	TestVerifyChecked   string
	TestVerifyHidden    string
	TestVerifyDisabled  string
	TestGenerateLocator string
	TestGetReport       string
	TestReset           string
	TestSetTarget       string

	// Accessibility
	AccessibilitySnapshot string

	// Video
	VideoStart string
	VideoStop  string

	// Human-in-the-loop
	HumanPause string

	// Config
	ConfigGet string

	// CDP - Performance
	CDPGetPerformanceMetrics string
	CDPGetMemoryStats        string
	CDPTakeHeapSnapshot      string

	// CDP - Emulation
	CDPEmulateNetwork        string
	CDPClearNetworkEmulation string
	CDPEmulateCPU            string
	CDPClearCPUEmulation     string

	// CDP - Quality
	CDPRunLighthouse string

	// CDP - Coverage
	CDPStartCoverage string
	CDPStopCoverage  string

	// CDP - Console
	CDPEnableConsoleDebugger  string
	CDPGetConsoleEntries      string
	CDPGetBrowserLogs         string
	CDPDisableConsoleDebugger string

	// CDP - Screencast
	CDPStartScreencast string
	CDPStopScreencast  string

	// CDP - Extensions
	CDPInstallExtension   string
	CDPUninstallExtension string
	CDPListExtensions     string

	// CDP - Network
	CDPGetResponseBody string

	// Page - Inspection
	PageInspect string

	// Test - Validation
	TestValidateSelectors string

	// Workflow
	WorkflowLogin        string
	WorkflowExtractTable string

	// State
	StateSave   string
	StateLoad   string
	StateList   string
	StateDelete string

}{}/* 169 elements not displayed */

ToolNames defines the canonical tool names. This serves as the single source of truth for all tool names.

Functions

func CategorySummary

func CategorySummary() map[string]int

CategorySummary returns a summary of tools by category.

func ListToolsJSON

func ListToolsJSON() ([]byte, error)

ListToolsJSON returns the tool list as formatted JSON.

Types

type AccessibilitySnapshotInput

type AccessibilitySnapshotInput struct {
	InterestingOnly *bool  `json:"interesting_only,omitempty" jsonschema:"Only include interesting nodes with semantic meaning (default true)"`
	Root            string `json:"root,omitempty" jsonschema:"CSS selector for root element to snapshot"`
}

type AccessibilitySnapshotOutput

type AccessibilitySnapshotOutput struct {
	Snapshot interface{} `json:"snapshot"`
}

type AddInitScriptInput

type AddInitScriptInput struct {
	Script string `json:"script" jsonschema:"JavaScript code to inject before page scripts,required"`
}

type AddInitScriptOutput

type AddInitScriptOutput struct {
	Message string `json:"message"`
}

type AddScriptInput

type AddScriptInput struct {
	Source string `json:"source" jsonschema:"JavaScript source to inject,required"`
}

type AddScriptOutput

type AddScriptOutput struct {
	Message string `json:"message"`
}

type AddStyleInput

type AddStyleInput struct {
	Source string `json:"source" jsonschema:"CSS source to inject,required"`
}

type AddStyleOutput

type AddStyleOutput struct {
	Message string `json:"message"`
}

type AssertElementInput

type AssertElementInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type AssertElementOutput

type AssertElementOutput struct {
	Found   bool   `json:"found"`
	Message string `json:"message"`
}

type AssertTextInput

type AssertTextInput struct {
	Text     string `json:"text" jsonschema:"Text to search for,required"`
	Selector string `json:"selector" jsonschema:"Optional: limit search to element matching selector"`
}

type AssertTextOutput

type AssertTextOutput struct {
	Found   bool   `json:"found"`
	Message string `json:"message"`
}

type BackInput

type BackInput struct{}

type BackOutput

type BackOutput struct {
	Message string `json:"message"`
}

type BatchExecuteInput added in v0.8.0

type BatchExecuteInput struct {
	Steps           []BatchStep `json:"steps" jsonschema:"Array of tool steps to execute sequentially,required"`
	StopOnError     bool        `json:"stop_on_error" jsonschema:"Stop execution on first error (default: true)"`
	ContinueOnError bool        `json:"continue_on_error" jsonschema:"Continue execution even if a step fails"`
}

BatchExecuteInput defines the input for batch_execute tool.

type BatchExecuteOutput added in v0.8.0

type BatchExecuteOutput struct {
	Results       []BatchStepResult `json:"results"`
	TotalSteps    int               `json:"total_steps"`
	SuccessCount  int               `json:"success_count"`
	FailureCount  int               `json:"failure_count"`
	StoppedEarly  bool              `json:"stopped_early,omitempty"`
	TotalDuration int64             `json:"total_duration_ms"`
}

BatchExecuteOutput defines the output for batch_execute tool.

type BatchStep added in v0.8.0

type BatchStep struct {
	Tool string         `json:"tool" jsonschema:"Tool name to execute,required"`
	Args map[string]any `json:"args" jsonschema:"Arguments for the tool"`
}

BatchStep represents a single step in a batch execution.

type BatchStepResult added in v0.8.0

type BatchStepResult struct {
	Tool       string `json:"tool"`
	Success    bool   `json:"success"`
	Result     any    `json:"result,omitempty"`
	Error      string `json:"error,omitempty"`
	DurationMS int64  `json:"duration_ms"`
}

BatchStepResult represents the result of a single batch step.

type BringToFrontInput

type BringToFrontInput struct{}

type BringToFrontOutput

type BringToFrontOutput struct {
	Message string `json:"message"`
}

type BrowserLaunchInput

type BrowserLaunchInput struct {
	Headless bool `json:"headless" jsonschema:"Run browser without GUI (default: true)"`
}

type BrowserLaunchOutput

type BrowserLaunchOutput struct {
	Message string `json:"message"`
}

type BrowserLogOutput

type BrowserLogOutput struct {
	Source     string            `json:"source"`
	Level      string            `json:"level"`
	Text       string            `json:"text"`
	URL        string            `json:"url,omitempty"`
	LineNumber int               `json:"lineNumber,omitempty"`
	Timestamp  float64           `json:"timestamp"`
	StackTrace []CallFrameOutput `json:"stackTrace,omitempty"`
}

type BrowserQuitInput

type BrowserQuitInput struct{}

type BrowserQuitOutput

type BrowserQuitOutput struct {
	Message string `json:"message"`
}

type CallFrameOutput

type CallFrameOutput struct {
	FunctionName string `json:"functionName"`
	URL          string `json:"url"`
	LineNumber   int    `json:"lineNumber"`
	ColumnNumber int    `json:"columnNumber"`
}

type CheckInput

type CheckInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the checkbox,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type CheckOutput

type CheckOutput struct {
	Message string `json:"message"`
}

type ClearCPUEmulationInput

type ClearCPUEmulationInput struct{}

type ClearCPUEmulationOutput

type ClearCPUEmulationOutput struct {
	Message string `json:"message"`
}

type ClearConsoleMessagesInput

type ClearConsoleMessagesInput struct{}

ClearConsoleMessagesInput for clearing console messages.

type ClearConsoleMessagesOutput

type ClearConsoleMessagesOutput struct {
	Message string `json:"message"`
}

ClearConsoleMessagesOutput confirms the clear operation.

type ClearCookiesInput

type ClearCookiesInput struct{}

type ClearCookiesOutput

type ClearCookiesOutput struct {
	Message string `json:"message"`
}

type ClearInput

type ClearInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the input element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type ClearNetworkEmulationInput

type ClearNetworkEmulationInput struct{}

type ClearNetworkEmulationOutput

type ClearNetworkEmulationOutput struct {
	Message string `json:"message"`
}

type ClearNetworkRequestsInput

type ClearNetworkRequestsInput struct{}

ClearNetworkRequestsInput for clearing network requests.

type ClearNetworkRequestsOutput

type ClearNetworkRequestsOutput struct {
	Message string `json:"message"`
}

ClearNetworkRequestsOutput confirms the clear operation.

type ClearOutput

type ClearOutput struct {
	Message string `json:"message"`
}

type ClearRecordingInput

type ClearRecordingInput struct{}

type ClearRecordingOutput

type ClearRecordingOutput struct {
	Message string `json:"message"`
}

type ClearStorageInput

type ClearStorageInput struct{}

type ClearStorageOutput

type ClearStorageOutput struct {
	Message string `json:"message"`
}

type ClickInput

type ClickInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element to click (can be empty if using semantic selectors)"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
	SemanticSelector
}

type ClickOutput

type ClickOutput struct {
	Message string `json:"message"`
}

type ClosePageInput

type ClosePageInput struct{}

type ClosePageOutput

type ClosePageOutput struct {
	Message string `json:"message"`
}

type CloseTabInput

type CloseTabInput struct {
	Index *int   `json:"index,omitempty" jsonschema:"Tab index to close (0-based). Defaults to current tab."`
	ID    string `json:"id,omitempty" jsonschema:"Tab ID to close (from list_tabs)"`
}

CloseTabInput for closing a specific tab.

type CloseTabOutput

type CloseTabOutput struct {
	Message string `json:"message"`
}

CloseTabOutput confirms the tab closure.

type Config

type Config struct {
	// Headless runs the browser without a GUI.
	Headless bool

	// Project is the project name for reports.
	Project string

	// DefaultTimeout is the default timeout for browser operations.
	DefaultTimeout time.Duration

	// InitScripts are JavaScript files to inject before any page scripts.
	// Each string is the content of a script (not a file path).
	InitScripts []string
}

Config holds server configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults.

type ConsoleEntryOutput

type ConsoleEntryOutput struct {
	Type       string            `json:"type"`
	Text       string            `json:"text"`
	Timestamp  float64           `json:"timestamp"`
	StackTrace []CallFrameOutput `json:"stackTrace,omitempty"`
}

type ConsoleMessageInfo

type ConsoleMessageInfo struct {
	Type string   `json:"type"`
	Text string   `json:"text"`
	Args []string `json:"args,omitempty"`
	URL  string   `json:"url,omitempty"`
	Line int      `json:"line,omitempty"`
}

ConsoleMessageInfo represents a console message.

type CookieOutput

type CookieOutput struct {
	Name     string  `json:"name"`
	Value    string  `json:"value"`
	Domain   string  `json:"domain"`
	Path     string  `json:"path"`
	Expires  float64 `json:"expires"`
	HTTPOnly bool    `json:"httpOnly"`
	Secure   bool    `json:"secure"`
	SameSite string  `json:"sameSite"`
}

type CoverageSummaryOutput

type CoverageSummaryOutput struct {
	JSScripts       int     `json:"jsScripts"`
	JSFunctions     int     `json:"jsFunctions"`
	JSCoveredRanges int     `json:"jsCoveredRanges"`
	CSSRules        int     `json:"cssRules"`
	CSSUsedRules    int     `json:"cssUsedRules"`
	CSSUnusedRules  int     `json:"cssUnusedRules"`
	CSSUsagePercent float64 `json:"cssUsagePercent"`
}

type DblClickInput

type DblClickInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type DblClickOutput

type DblClickOutput struct {
	Message string `json:"message"`
}

type DeleteCookieInput

type DeleteCookieInput struct {
	Name   string `json:"name" jsonschema:"Cookie name to delete,required"`
	Domain string `json:"domain,omitempty" jsonschema:"Cookie domain (optional filter)"`
	Path   string `json:"path,omitempty" jsonschema:"Cookie path (optional filter)"`
}

type DeleteCookieOutput

type DeleteCookieOutput struct {
	Message string `json:"message"`
}

type DisableConsoleDebuggerInput

type DisableConsoleDebuggerInput struct{}

type DisableConsoleDebuggerOutput

type DisableConsoleDebuggerOutput struct {
	Message string `json:"message"`
}

type DispatchEventInput

type DispatchEventInput struct {
	Selector  string         `json:"selector" jsonschema:"CSS selector for the element,required"`
	EventType string         `json:"event_type" jsonschema:"Event type (e.g. click focus blur),required"`
	EventInit map[string]any `json:"event_init" jsonschema:"Event initialization options"`
	TimeoutMS int            `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type DispatchEventOutput

type DispatchEventOutput struct {
	Message string `json:"message"`
}

type DragToInput

type DragToInput struct {
	SourceSelector string `json:"source_selector" jsonschema:"CSS selector for the element to drag,required"`
	TargetSelector string `json:"target_selector" jsonschema:"CSS selector for the drop target,required"`
	TimeoutMS      int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type DragToOutput

type DragToOutput struct {
	Message string `json:"message"`
}

type ElementEvalInput

type ElementEvalInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	Function  string `json:"function" jsonschema:"JavaScript function (receives element as first arg),required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type ElementEvalOutput

type ElementEvalOutput struct {
	Result any `json:"result"`
}

type ElementScreenshotInput

type ElementScreenshotInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type ElementScreenshotOutput

type ElementScreenshotOutput struct {
	Data string `json:"data"`
}

type EmulateCPUInput

type EmulateCPUInput struct {
	Rate int `` /* 141-byte string literal not displayed */
}

type EmulateCPUOutput

type EmulateCPUOutput struct {
	Message string `json:"message"`
	Rate    int    `json:"rate"`
}

type EmulateMediaInput

type EmulateMediaInput struct {
	Media         string `json:"media,omitempty" jsonschema:"Media type: screen or print. Empty to reset."`
	ColorScheme   string `` /* 167-byte string literal not displayed */
	ReducedMotion string `` /* 164-byte string literal not displayed */
	ForcedColors  string `` /* 141-byte string literal not displayed */
	Contrast      string `` /* 164-byte string literal not displayed */
}

type EmulateMediaOutput

type EmulateMediaOutput struct {
	Message  string   `json:"message"`
	Settings []string `json:"settings"`
}

type EmulateNetworkInput

type EmulateNetworkInput struct {
	Preset             string  `` /* 131-byte string literal not displayed */
	Latency            float64 `json:"latency" jsonschema:"Custom latency in ms (overrides preset)"`
	DownloadThroughput float64 `json:"download_throughput" jsonschema:"Custom download throughput in bytes/s (overrides preset)"`
	UploadThroughput   float64 `json:"upload_throughput" jsonschema:"Custom upload throughput in bytes/s (overrides preset)"`
}

type EmulateNetworkOutput

type EmulateNetworkOutput struct {
	Message string `json:"message"`
	Preset  string `json:"preset,omitempty"`
}

type EnableConsoleDebuggerInput

type EnableConsoleDebuggerInput struct{}

type EnableConsoleDebuggerOutput

type EnableConsoleDebuggerOutput struct {
	Message string `json:"message"`
}

type EvaluateInput

type EvaluateInput struct {
	Script        string `json:"script" jsonschema:"JavaScript to execute,required"`
	MaxResultSize int    `json:"max_result_size" jsonschema:"Maximum result size in characters (0=unlimited). If exceeded the result is truncated."`
}

type EvaluateOutput

type EvaluateOutput struct {
	Result    any  `json:"result"`
	Truncated bool `json:"truncated,omitempty"`
}

type ExportScriptInput

type ExportScriptInput struct {
	Format string `json:"format,omitempty" jsonschema:"Output format: json or yaml (default: json),enum=json,enum=yaml"`
}

type ExportScriptOutput

type ExportScriptOutput struct {
	Script    string `json:"script"`
	StepCount int    `json:"stepCount"`
	Format    string `json:"format"`
}

type ExtensionInfoOutput

type ExtensionInfoOutput struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Version     string `json:"version,omitempty"`
	Description string `json:"description,omitempty"`
	Enabled     bool   `json:"enabled"`
}

type FillFormInput

type FillFormInput struct {
	Fields    []FormField `json:"fields" jsonschema:"Array of fields to fill (each with selector and value),required"`
	TimeoutMS int         `json:"timeout_ms" jsonschema:"Timeout in milliseconds per field (default: 5000)"`
}

type FillFormOutput

type FillFormOutput struct {
	Message string   `json:"message"`
	Filled  int      `json:"filled"`
	Errors  []string `json:"errors,omitempty"`
}

type FillInput

type FillInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the input element (can be empty if using semantic selectors)"`
	Value     string `json:"value" jsonschema:"Value to fill,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
	SemanticSelector
}

type FillOutput

type FillOutput struct {
	Message string `json:"message"`
}

type FocusInput

type FocusInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type FocusOutput

type FocusOutput struct {
	Message string `json:"message"`
}

type FormField

type FormField struct {
	Selector string `json:"selector" jsonschema:"CSS selector for the input element,required"`
	Value    string `json:"value" jsonschema:"Value to fill,required"`
}

FormField represents a single field to fill.

type ForwardInput

type ForwardInput struct{}

type ForwardOutput

type ForwardOutput struct {
	Message string `json:"message"`
}

type FrameInfoOutput

type FrameInfoOutput struct {
	URL  string `json:"url"`
	Name string `json:"name"`
}

type GenerateLocatorInput

type GenerateLocatorInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	Strategy  string `` /* 140-byte string literal not displayed */
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GenerateLocatorOutput

type GenerateLocatorOutput struct {
	Locator  string            `json:"locator"`
	Strategy string            `json:"strategy"`
	Metadata map[string]string `json:"metadata"`
}

type GetAttributeInput

type GetAttributeInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	Name      string `json:"name" jsonschema:"Attribute name,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetAttributeOutput

type GetAttributeOutput struct {
	Value string `json:"value"`
}

type GetBoundingBoxInput

type GetBoundingBoxInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetBoundingBoxOutput

type GetBoundingBoxOutput struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

type GetBrowserLogsInput

type GetBrowserLogsInput struct {
	Source string `json:"source" jsonschema:"Filter by source: network, violation, intervention, deprecation (optional)"`
	Level  string `json:"level" jsonschema:"Filter by level: verbose, info, warning, error (optional)"`
}

type GetBrowserLogsOutput

type GetBrowserLogsOutput struct {
	Logs  []BrowserLogOutput `json:"logs"`
	Count int                `json:"count"`
}

type GetConfigInput

type GetConfigInput struct{}

type GetConfigOutput

type GetConfigOutput struct {
	Headless         bool   `json:"headless"`
	Project          string `json:"project"`
	DefaultTimeoutMS int64  `json:"default_timeout_ms"`
	BrowserLaunched  bool   `json:"browser_launched"`
}

type GetConsoleEntriesWithStackInput

type GetConsoleEntriesWithStackInput struct {
	Type  string `json:"type" jsonschema:"Filter by message type: log, debug, info, error, warning, trace (optional)"`
	Limit int    `json:"limit" jsonschema:"Maximum number of entries to return (default: all)"`
}

type GetConsoleEntriesWithStackOutput

type GetConsoleEntriesWithStackOutput struct {
	Entries []ConsoleEntryOutput `json:"entries"`
	Count   int                  `json:"count"`
}

type GetConsoleMessagesInput

type GetConsoleMessagesInput struct {
	Level string `` /* 161-byte string literal not displayed */
	Clear bool   `json:"clear,omitempty" jsonschema:"Clear messages after retrieving them"`
}

GetConsoleMessagesInput for retrieving console messages.

type GetConsoleMessagesOutput

type GetConsoleMessagesOutput struct {
	Messages []ConsoleMessageInfo `json:"messages"`
	Count    int                  `json:"count"`
}

GetConsoleMessagesOutput contains console messages.

type GetContentInput

type GetContentInput struct{}

type GetContentOutput

type GetContentOutput struct {
	Content string `json:"content"`
}

type GetCookiesInput

type GetCookiesInput struct {
	URLs []string `json:"urls" jsonschema:"URLs to get cookies for (optional)"`
}

type GetCookiesOutput

type GetCookiesOutput struct {
	Cookies []CookieOutput `json:"cookies"`
}

type GetDialogInput

type GetDialogInput struct{}

GetDialogInput for getting the current dialog state.

type GetDialogOutput

type GetDialogOutput struct {
	HasDialog    bool   `json:"has_dialog"`
	DialogType   string `json:"dialog_type,omitempty"`
	Message      string `json:"message,omitempty"`
	DefaultValue string `json:"default_value,omitempty"`
}

GetDialogOutput contains dialog information.

type GetFramesInput

type GetFramesInput struct{}

type GetFramesOutput

type GetFramesOutput struct {
	Frames []FrameInfoOutput `json:"frames"`
}

type GetInnerHTMLInput

type GetInnerHTMLInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetInnerHTMLOutput

type GetInnerHTMLOutput struct {
	HTML string `json:"html"`
}

type GetInnerTextInput

type GetInnerTextInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetInnerTextOutput

type GetInnerTextOutput struct {
	Text string `json:"text"`
}

type GetLabelInput

type GetLabelInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetLabelOutput

type GetLabelOutput struct {
	Label string `json:"label"`
}

type GetMemoryStatsInput

type GetMemoryStatsInput struct{}

type GetMemoryStatsOutput

type GetMemoryStatsOutput struct {
	UsedJSHeapSize  int64  `json:"usedJSHeapSize"`  // Used JS heap size in bytes
	TotalJSHeapSize int64  `json:"totalJSHeapSize"` // Total JS heap size in bytes
	JSHeapSizeLimit int64  `json:"jsHeapSizeLimit"` // JS heap size limit in bytes
	UsedMB          string `json:"usedMB"`          // Human-readable used size
	TotalMB         string `json:"totalMB"`         // Human-readable total size
	LimitMB         string `json:"limitMB"`         // Human-readable limit
	UsagePercent    string `json:"usagePercent"`    // Usage percentage
}

type GetNetworkRequestBodyInput

type GetNetworkRequestBodyInput struct {
	RequestID  string `json:"request_id" jsonschema:"The request ID from get_network_requests output,required"`
	SaveToFile string `json:"save_to_file" jsonschema:"File path to save binary content (optional, returns base64 if not set)"`
}

type GetNetworkRequestBodyOutput

type GetNetworkRequestBodyOutput struct {
	Body          string `json:"body,omitempty"`        // Text body (if not binary or saved to file)
	Base64Encoded bool   `json:"base64Encoded"`         // Whether body is base64 encoded
	SavedToFile   string `json:"savedToFile,omitempty"` // File path if saved
	Size          int    `json:"size"`                  // Body size in bytes
	Message       string `json:"message"`
}

type GetNetworkRequestsInput

type GetNetworkRequestsInput struct {
	URLPattern   string `json:"url_pattern,omitempty" jsonschema:"Filter by URL pattern (glob or regex)"`
	Method       string `json:"method,omitempty" jsonschema:"Filter by HTTP method (GET/POST/PUT/DELETE/etc)"`
	ResourceType string `json:"resource_type,omitempty" jsonschema:"Filter by resource type (document/script/xhr/fetch/stylesheet/image/font/other)"`
	Clear        bool   `json:"clear,omitempty" jsonschema:"Clear requests after retrieving them"`
}

GetNetworkRequestsInput for retrieving network requests.

type GetNetworkRequestsOutput

type GetNetworkRequestsOutput struct {
	Requests []NetworkRequestInfo `json:"requests"`
	Count    int                  `json:"count"`
}

GetNetworkRequestsOutput contains network requests.

type GetOuterHTMLInput

type GetOuterHTMLInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetOuterHTMLOutput

type GetOuterHTMLOutput struct {
	HTML string `json:"html"`
}

type GetPagesInput

type GetPagesInput struct{}

type GetPagesOutput

type GetPagesOutput struct {
	Count int `json:"count"`
}

type GetPerformanceMetricsInput

type GetPerformanceMetricsInput struct{}

type GetPerformanceMetricsOutput

type GetPerformanceMetricsOutput struct {
	// Core Web Vitals
	LCP  float64 `json:"lcp,omitempty"`  // Largest Contentful Paint (ms)
	CLS  float64 `json:"cls,omitempty"`  // Cumulative Layout Shift
	INP  float64 `json:"inp,omitempty"`  // Interaction to Next Paint (ms)
	FID  float64 `json:"fid,omitempty"`  // First Input Delay (ms)
	FCP  float64 `json:"fcp,omitempty"`  // First Contentful Paint (ms)
	TTFB float64 `json:"ttfb,omitempty"` // Time to First Byte (ms)

	// Navigation Timing
	DOMContentLoaded float64 `json:"domContentLoaded,omitempty"` // DOMContentLoaded event (ms)
	Load             float64 `json:"load,omitempty"`             // Load event (ms)
	DOMInteractive   float64 `json:"domInteractive,omitempty"`   // DOM interactive (ms)

	// Resource Timing
	ResourceCount int `json:"resourceCount,omitempty"` // Number of resources loaded
}

type GetRoleInput

type GetRoleInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetRoleOutput

type GetRoleOutput struct {
	Role string `json:"role"`
}

type GetStorageStateInput

type GetStorageStateInput struct{}

type GetStorageStateOutput

type GetStorageStateOutput struct {
	State string `json:"state"`
}

type GetTestReportInput

type GetTestReportInput struct {
	Format string `` /* 144-byte string literal not displayed */
}

type GetTestReportOutput

type GetTestReportOutput struct {
	Report string `json:"report"`
}

type GetTextInput

type GetTextInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetTextOutput

type GetTextOutput struct {
	Text string `json:"text"`
}

type GetTitleInput

type GetTitleInput struct{}

type GetTitleOutput

type GetTitleOutput struct {
	Title string `json:"title"`
}

type GetURLInput

type GetURLInput struct{}

type GetURLOutput

type GetURLOutput struct {
	URL string `json:"url"`
}

type GetValueInput

type GetValueInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the input element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type GetValueOutput

type GetValueOutput struct {
	Value string `json:"value"`
}

type GetViewportInput

type GetViewportInput struct{}

type GetViewportOutput

type GetViewportOutput struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type HTTPRequestInput added in v0.8.0

type HTTPRequestInput struct {
	URL           string            `json:"url" jsonschema:"URL to fetch (absolute or relative to current page),required"`
	Method        string            `json:"method" jsonschema:"HTTP method (GET POST PUT DELETE PATCH HEAD OPTIONS),default=GET"`
	Headers       map[string]string `json:"headers" jsonschema:"Additional HTTP headers to include"`
	ContentType   string            `json:"content_type" jsonschema:"Content-Type header value (convenience for common types)"`
	Body          string            `json:"body" jsonschema:"Request body (for POST PUT PATCH)"`
	MaxBodyLength int               `json:"max_body_length" jsonschema:"Maximum response body length in characters (0=unlimited),default=8192"`
}

HTTPRequestInput defines the input for the http_request tool.

type HTTPRequestOutput added in v0.8.0

type HTTPRequestOutput struct {
	Status     int               `json:"status"`
	StatusText string            `json:"status_text"`
	Headers    map[string]string `json:"headers"`
	Body       string            `json:"body"`
	Truncated  bool              `json:"truncated"`
	URL        string            `json:"url"`
}

HTTPRequestOutput defines the output for the http_request tool.

type HandleDialogInput

type HandleDialogInput struct {
	Action     string `json:"action" jsonschema:"Action to take: accept or dismiss,enum=accept,enum=dismiss,required"`
	PromptText string `json:"prompt_text,omitempty" jsonschema:"Text to enter for prompt dialogs (only used with accept action)"`
}

HandleDialogInput for handling browser dialogs.

type HandleDialogOutput

type HandleDialogOutput struct {
	Message string `json:"message"`
	Action  string `json:"action"`
}

HandleDialogOutput confirms the dialog action.

type HoverInput

type HoverInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type HoverOutput

type HoverOutput struct {
	Message string `json:"message"`
}

type InstallExtensionInput

type InstallExtensionInput struct {
	Path string `json:"path" jsonschema:"Path to unpacked extension directory,required"`
}

type InstallExtensionOutput

type InstallExtensionOutput struct {
	ID      string `json:"id"`
	Message string `json:"message"`
}

type IsCheckedInput

type IsCheckedInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the checkbox/radio,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type IsCheckedOutput

type IsCheckedOutput struct {
	Checked bool `json:"checked"`
}

type IsEditableInput

type IsEditableInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type IsEditableOutput

type IsEditableOutput struct {
	Editable bool `json:"editable"`
}

type IsEnabledInput

type IsEnabledInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type IsEnabledOutput

type IsEnabledOutput struct {
	Enabled bool `json:"enabled"`
}

type IsHiddenInput

type IsHiddenInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type IsHiddenOutput

type IsHiddenOutput struct {
	Hidden bool `json:"hidden"`
}

type IsVisibleInput

type IsVisibleInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type IsVisibleOutput

type IsVisibleOutput struct {
	Visible bool `json:"visible"`
}

type KeyboardDownInput

type KeyboardDownInput struct {
	Key string `json:"key" jsonschema:"Key to hold down,required"`
}

type KeyboardDownOutput

type KeyboardDownOutput struct {
	Message string `json:"message"`
}

type KeyboardPressInput

type KeyboardPressInput struct {
	Key string `json:"key" jsonschema:"Key to press (e.g. Enter Tab ArrowDown),required"`
}

type KeyboardPressOutput

type KeyboardPressOutput struct {
	Message string `json:"message"`
}

type KeyboardTypeInput

type KeyboardTypeInput struct {
	Text string `json:"text" jsonschema:"Text to type,required"`
}

type KeyboardTypeOutput

type KeyboardTypeOutput struct {
	Message string `json:"message"`
}

type KeyboardUpInput

type KeyboardUpInput struct {
	Key string `json:"key" jsonschema:"Key to release,required"`
}

type KeyboardUpOutput

type KeyboardUpOutput struct {
	Message string `json:"message"`
}

type LighthouseAuditInput

type LighthouseAuditInput struct {
	Categories []string `` /* 137-byte string literal not displayed */
	Device     string   `json:"device" jsonschema:"Device to emulate: desktop or mobile (default: desktop),enum=desktop,enum=mobile"`
	OutputDir  string   `json:"output_dir" jsonschema:"Directory to save reports (optional, uses temp dir if empty)"`
}

type LighthouseAuditOutput

type LighthouseAuditOutput struct {
	URL             string                        `json:"url"`
	Device          string                        `json:"device"`
	Scores          map[string]LighthouseScoreOut `json:"scores"`
	PassedAudits    int                           `json:"passedAudits"`
	FailedAudits    int                           `json:"failedAudits"`
	TotalDurationMS float64                       `json:"totalDurationMs"`
	JSONReportPath  string                        `json:"jsonReportPath,omitempty"`
	HTMLReportPath  string                        `json:"htmlReportPath,omitempty"`
	Message         string                        `json:"message"`
}

type LighthouseScoreOut

type LighthouseScoreOut struct {
	Title    string  `json:"title"`
	Score    int     `json:"score"`    // 0-100
	RawScore float64 `json:"rawScore"` // 0-1
}

type ListExtensionsInput

type ListExtensionsInput struct{}

type ListExtensionsOutput

type ListExtensionsOutput struct {
	Extensions []ExtensionInfoOutput `json:"extensions"`
	Count      int                   `json:"count"`
}

type ListTabsInput

type ListTabsInput struct{}

ListTabsInput for listing all open tabs.

type ListTabsOutput

type ListTabsOutput struct {
	Tabs       []TabInfo `json:"tabs"`
	Count      int       `json:"count"`
	CurrentTab int       `json:"current_tab"`
}

ListTabsOutput contains all open tabs.

type LocalStorageClearInput

type LocalStorageClearInput struct{}

LocalStorageClearInput for clearing all localStorage.

type LocalStorageClearOutput

type LocalStorageClearOutput struct {
	Message string `json:"message"`
}

LocalStorageClearOutput confirms the operation.

type LocalStorageDeleteInput

type LocalStorageDeleteInput struct {
	Key string `json:"key" jsonschema:"The key to remove from localStorage,required"`
}

LocalStorageDeleteInput for removing a localStorage item.

type LocalStorageDeleteOutput

type LocalStorageDeleteOutput struct {
	Message string `json:"message"`
}

LocalStorageDeleteOutput confirms the operation.

type LocalStorageGetInput

type LocalStorageGetInput struct {
	Key string `json:"key" jsonschema:"The key to get from localStorage,required"`
}

LocalStorageGetInput for getting a localStorage item.

type LocalStorageGetOutput

type LocalStorageGetOutput struct {
	Key   string  `json:"key"`
	Value *string `json:"value"` // null if key doesn't exist
}

LocalStorageGetOutput contains the retrieved value.

type LocalStorageListInput

type LocalStorageListInput struct{}

LocalStorageListInput for listing all localStorage items.

type LocalStorageListOutput

type LocalStorageListOutput struct {
	Items map[string]string `json:"items"`
	Count int               `json:"count"`
}

LocalStorageListOutput contains all localStorage items.

type LocalStorageSetInput

type LocalStorageSetInput struct {
	Key   string `json:"key" jsonschema:"The key to set in localStorage,required"`
	Value string `json:"value" jsonschema:"The value to store,required"`
}

LocalStorageSetInput for setting a localStorage item.

type LocalStorageSetOutput

type LocalStorageSetOutput struct {
	Message string `json:"message"`
}

LocalStorageSetOutput confirms the operation.

type MouseClickInput

type MouseClickInput struct {
	X          float64 `json:"x" jsonschema:"X coordinate,required"`
	Y          float64 `json:"y" jsonschema:"Y coordinate,required"`
	Button     string  `json:"button" jsonschema:"Mouse button: left right middle"`
	ClickCount int     `json:"click_count" jsonschema:"Number of clicks (default: 1)"`
}

type MouseClickOutput

type MouseClickOutput struct {
	Message string `json:"message"`
}

type MouseDownInput

type MouseDownInput struct {
	Button string `json:"button" jsonschema:"Mouse button: left right middle"`
}

type MouseDownOutput

type MouseDownOutput struct {
	Message string `json:"message"`
}

type MouseDragInput

type MouseDragInput struct {
	StartX float64 `json:"start_x" jsonschema:"Starting X coordinate,required"`
	StartY float64 `json:"start_y" jsonschema:"Starting Y coordinate,required"`
	EndX   float64 `json:"end_x" jsonschema:"Ending X coordinate,required"`
	EndY   float64 `json:"end_y" jsonschema:"Ending Y coordinate,required"`
	Steps  int     `json:"steps,omitempty" jsonschema:"Number of intermediate steps (default: 10)"`
}

type MouseDragOutput

type MouseDragOutput struct {
	Message string `json:"message"`
}

type MouseMoveInput

type MouseMoveInput struct {
	X float64 `json:"x" jsonschema:"X coordinate,required"`
	Y float64 `json:"y" jsonschema:"Y coordinate,required"`
}

type MouseMoveOutput

type MouseMoveOutput struct {
	Message string `json:"message"`
}

type MouseUpInput

type MouseUpInput struct {
	Button string `json:"button" jsonschema:"Mouse button: left right middle"`
}

type MouseUpOutput

type MouseUpOutput struct {
	Message string `json:"message"`
}

type MouseWheelInput

type MouseWheelInput struct {
	DeltaX float64 `json:"delta_x" jsonschema:"Horizontal scroll amount"`
	DeltaY float64 `json:"delta_y" jsonschema:"Vertical scroll amount"`
}

type MouseWheelOutput

type MouseWheelOutput struct {
	Message string `json:"message"`
}
type NavigateInput struct {
	URL string `json:"url" jsonschema:"The URL to navigate to,required"`
}
type NavigateOutput struct {
	URL   string `json:"url"`
	Title string `json:"title"`
}

type NetworkRequestInfo

type NetworkRequestInfo struct {
	URL          string `json:"url"`
	Method       string `json:"method"`
	ResourceType string `json:"resource_type"`
	Status       int    `json:"status,omitempty"`
	StatusText   string `json:"status_text,omitempty"`
	ResponseSize int64  `json:"response_size,omitempty"`
}

NetworkRequestInfo represents a network request.

type NetworkStateSetInput

type NetworkStateSetInput struct {
	Offline bool `json:"offline" jsonschema:"Set to true to enable offline mode,required"`
}

type NetworkStateSetOutput

type NetworkStateSetOutput struct {
	Message string `json:"message"`
	Offline bool   `json:"offline"`
}

type NewPageInput

type NewPageInput struct{}

type NewPageOutput

type NewPageOutput struct {
	Message string `json:"message"`
}

type PDFInput

type PDFInput struct {
	Scale           float64 `json:"scale" jsonschema:"Scale of the PDF (default: 1)"`
	PrintBackground bool    `json:"print_background" jsonschema:"Print background graphics"`
	Landscape       bool    `json:"landscape" jsonschema:"Landscape orientation"`
	Format          string  `json:"format" jsonschema:"Paper format (Letter Legal A4 etc)"`
}

type PDFOutput

type PDFOutput struct {
	Data string `json:"data"`
}

type PageInspectInput

type PageInspectInput struct {
	IncludeButtons  *bool `json:"include_buttons,omitempty" jsonschema:"Include button elements (default true)"`
	IncludeLinks    *bool `json:"include_links,omitempty" jsonschema:"Include link elements (default true)"`
	IncludeInputs   *bool `json:"include_inputs,omitempty" jsonschema:"Include input elements (default true)"`
	IncludeSelects  *bool `json:"include_selects,omitempty" jsonschema:"Include select elements (default true)"`
	IncludeHeadings *bool `json:"include_headings,omitempty" jsonschema:"Include heading elements (default true)"`
	IncludeImages   *bool `json:"include_images,omitempty" jsonschema:"Include images with alt text (default true)"`
	MaxItems        int   `json:"max_items,omitempty" jsonschema:"Maximum items per category (default 50)"`
}

type PageInspectOutput

type PageInspectOutput struct {
	URL      string                   `json:"url"`
	Title    string                   `json:"title"`
	Buttons  []w3pilot.InspectButton  `json:"buttons,omitempty"`
	Links    []w3pilot.InspectLink    `json:"links,omitempty"`
	Inputs   []w3pilot.InspectInput   `json:"inputs,omitempty"`
	Selects  []w3pilot.InspectSelect  `json:"selects,omitempty"`
	Headings []w3pilot.InspectHeading `json:"headings,omitempty"`
	Images   []w3pilot.InspectImage   `json:"images,omitempty"`
	Summary  w3pilot.InspectSummary   `json:"summary"`
}

type PauseForHumanInput

type PauseForHumanInput struct {
	Message   string `json:"message" jsonschema:"Message to display to the human (e.g. 'Please complete the login')"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Maximum time to wait in milliseconds (default: 300000 = 5 minutes)"`
}

type PauseForHumanOutput

type PauseForHumanOutput struct {
	Message string `json:"message"`
}

type PressInput

type PressInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element (can be empty if using semantic selectors)"`
	Key       string `json:"key" jsonschema:"Key to press (e.g. Enter Tab ArrowDown),required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
	SemanticSelector
}

type PressOutput

type PressOutput struct {
	Message string `json:"message"`
}

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder captures MCP tool calls and converts them to a script.

func NewRecorder

func NewRecorder() *Recorder

NewRecorder creates a new Recorder.

func (*Recorder) AddStep

func (r *Recorder) AddStep(step script.Step)

AddStep records a step if recording is active.

func (*Recorder) Clear

func (r *Recorder) Clear()

Clear removes all recorded steps.

func (*Recorder) Export

func (r *Recorder) Export() *script.Script

Export returns the recorded session as a Script.

func (*Recorder) ExportJSON

func (r *Recorder) ExportJSON() ([]byte, error)

ExportJSON returns the recorded session as JSON.

func (*Recorder) IsRecording

func (r *Recorder) IsRecording() bool

IsRecording returns whether recording is active.

func (*Recorder) RecordAccessibilityCheck

func (r *Recorder) RecordAccessibilityCheck(standard, failOn string)

RecordAccessibilityCheck records an assertAccessibility action.

func (*Recorder) RecordAssertElement

func (r *Recorder) RecordAssertElement(selector string)

RecordAssertElement records an assertElement action.

func (*Recorder) RecordAssertText

func (r *Recorder) RecordAssertText(selector, expected string)

RecordAssertText records an assertText action.

func (*Recorder) RecordAssertTitle

func (r *Recorder) RecordAssertTitle(expected string)

RecordAssertTitle records an assertTitle action.

func (*Recorder) RecordAssertURL

func (r *Recorder) RecordAssertURL(expected string)

RecordAssertURL records an assertUrl action.

func (*Recorder) RecordAssertVisible

func (r *Recorder) RecordAssertVisible(selector string)

RecordAssertVisible records an assertVisible action.

func (*Recorder) RecordBack

func (r *Recorder) RecordBack()

RecordBack records a back action.

func (*Recorder) RecordCheck

func (r *Recorder) RecordCheck(selector string)

RecordCheck records a check action.

func (*Recorder) RecordClear

func (r *Recorder) RecordClear(selector string)

RecordClear records a clear action.

func (*Recorder) RecordClick

func (r *Recorder) RecordClick(selector string)

RecordClick records a click action.

func (*Recorder) RecordDblClick

func (r *Recorder) RecordDblClick(selector string)

RecordDblClick records a double-click action.

func (*Recorder) RecordDragTo

func (r *Recorder) RecordDragTo(selector, target string)

RecordDragTo records a dragTo action.

func (*Recorder) RecordEval

func (r *Recorder) RecordEval(js string)

RecordEval records an eval action.

func (*Recorder) RecordFill

func (r *Recorder) RecordFill(selector, value string)

RecordFill records a fill action.

func (*Recorder) RecordFocus

func (r *Recorder) RecordFocus(selector string)

RecordFocus records a focus action.

func (*Recorder) RecordForward

func (r *Recorder) RecordForward()

RecordForward records a forward action.

func (*Recorder) RecordHover

func (r *Recorder) RecordHover(selector string)

RecordHover records a hover action.

func (*Recorder) RecordKeyboardPress

func (r *Recorder) RecordKeyboardPress(key string)

RecordKeyboardPress records a keyboardPress action.

func (*Recorder) RecordKeyboardType

func (r *Recorder) RecordKeyboardType(text string)

RecordKeyboardType records a keyboardType action.

func (*Recorder) RecordMouseClick

func (r *Recorder) RecordMouseClick(x, y float64)

RecordMouseClick records a mouseClick action.

func (*Recorder) RecordMouseMove

func (r *Recorder) RecordMouseMove(x, y float64)

RecordMouseMove records a mouseMove action.

func (*Recorder) RecordNavigate

func (r *Recorder) RecordNavigate(url string)

RecordNavigate records a navigation action.

func (*Recorder) RecordPress

func (r *Recorder) RecordPress(selector, key string)

RecordPress records a press action.

func (*Recorder) RecordReload

func (r *Recorder) RecordReload()

RecordReload records a reload action.

func (*Recorder) RecordScreenshot

func (r *Recorder) RecordScreenshot(file string, fullPage bool)

RecordScreenshot records a screenshot action.

func (*Recorder) RecordScrollIntoView

func (r *Recorder) RecordScrollIntoView(selector string)

RecordScrollIntoView records a scroll action.

func (*Recorder) RecordSelect

func (r *Recorder) RecordSelect(selector, value string)

RecordSelect records a select action.

func (*Recorder) RecordSetFiles

func (r *Recorder) RecordSetFiles(selector string, files []string)

RecordSetFiles records a setFiles action.

func (*Recorder) RecordSetViewport

func (r *Recorder) RecordSetViewport(width, height int)

RecordSetViewport records a setViewport action.

func (*Recorder) RecordTap

func (r *Recorder) RecordTap(selector string)

RecordTap records a tap action.

func (*Recorder) RecordType

func (r *Recorder) RecordType(selector, text string)

RecordType records a type action.

func (*Recorder) RecordUncheck

func (r *Recorder) RecordUncheck(selector string)

RecordUncheck records an uncheck action.

func (*Recorder) RecordWait

func (r *Recorder) RecordWait(duration string)

RecordWait records a wait action.

func (*Recorder) RecordWaitForLoad

func (r *Recorder) RecordWaitForLoad(state string)

RecordWaitForLoad records a waitForLoad action.

func (*Recorder) RecordWaitForSelector

func (r *Recorder) RecordWaitForSelector(selector, state string)

RecordWaitForSelector records a waitForSelector action.

func (*Recorder) RecordWaitForURL

func (r *Recorder) RecordWaitForURL(pattern string)

RecordWaitForURL records a waitForUrl action.

func (*Recorder) Start

func (r *Recorder) Start(metadata RecorderMetadata)

Start begins recording actions.

func (*Recorder) StepCount

func (r *Recorder) StepCount() int

StepCount returns the number of recorded steps.

func (*Recorder) Steps

func (r *Recorder) Steps() []script.Step

Steps returns a copy of the recorded steps.

func (*Recorder) Stop

func (r *Recorder) Stop()

Stop ends recording.

type RecorderMetadata

type RecorderMetadata struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	BaseURL     string `json:"baseUrl,omitempty"`
}

RecorderMetadata contains metadata about the recording session.

type RecordingStatusInput

type RecordingStatusInput struct{}

type RecordingStatusOutput

type RecordingStatusOutput struct {
	Recording bool `json:"recording"`
	StepCount int  `json:"stepCount"`
}

type ReloadInput

type ReloadInput struct{}

type ReloadOutput

type ReloadOutput struct {
	Message string `json:"message"`
}

type ResetSessionInput

type ResetSessionInput struct{}

type ResetSessionOutput

type ResetSessionOutput struct {
	Message string `json:"message"`
}

type RouteInfoOutput

type RouteInfoOutput struct {
	Pattern     string `json:"pattern"`
	Status      int    `json:"status,omitempty"`
	ContentType string `json:"content_type,omitempty"`
}

type RouteInput

type RouteInput struct {
	Pattern     string            `json:"pattern" jsonschema:"URL pattern to match (glob or regex e.g. **/api/* or /api/.*),required"`
	Status      int               `json:"status" jsonschema:"HTTP status code (default: 200)"`
	Body        string            `json:"body" jsonschema:"Response body content"`
	ContentType string            `json:"content_type" jsonschema:"Content-Type header (default: application/json)"`
	Headers     map[string]string `json:"headers" jsonschema:"Additional response headers"`
}

type RouteListInput

type RouteListInput struct{}

type RouteListOutput

type RouteListOutput struct {
	Routes []RouteInfoOutput `json:"routes"`
	Count  int               `json:"count"`
}

type RouteOutput

type RouteOutput struct {
	Message string `json:"message"`
	Pattern string `json:"pattern"`
}

type ScreenshotInput

type ScreenshotInput struct {
	Format string `json:"format" jsonschema:"Output format: base64 (default) or file,enum=base64,enum=file"`
	Path   string `json:"path" jsonschema:"File path (required if format is file)"`
}

type ScreenshotOutput

type ScreenshotOutput struct {
	Format string `json:"format"`
	Data   string `json:"data,omitempty"`
	Path   string `json:"path,omitempty"`
}

type ScrollInput

type ScrollInput struct {
	Direction string `json:"direction" jsonschema:"Scroll direction: up down left right,required,enum=up,enum=down,enum=left,enum=right"`
	Amount    int    `json:"amount" jsonschema:"Amount to scroll in pixels (0 for full page scroll)"`
	Selector  string `json:"selector" jsonschema:"Optional CSS selector to scroll within a specific element"`
}

type ScrollIntoViewInput

type ScrollIntoViewInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type ScrollIntoViewOutput

type ScrollIntoViewOutput struct {
	Message string `json:"message"`
}

type ScrollOutput

type ScrollOutput struct {
	Message string `json:"message"`
}

type SelectFrameInput

type SelectFrameInput struct {
	NameOrURL string `json:"name_or_url" jsonschema:"Frame name or URL pattern to match,required"`
}

type SelectFrameOutput

type SelectFrameOutput struct {
	Message string `json:"message"`
	URL     string `json:"url"`
	Name    string `json:"name"`
}

type SelectMainFrameInput

type SelectMainFrameInput struct{}

type SelectMainFrameOutput

type SelectMainFrameOutput struct {
	Message string `json:"message"`
}

type SelectOptionInput

type SelectOptionInput struct {
	Selector  string   `json:"selector" jsonschema:"CSS selector for the select element,required"`
	Values    []string `json:"values" jsonschema:"Option values to select"`
	Labels    []string `json:"labels" jsonschema:"Option labels to select"`
	Indexes   []int    `json:"indexes" jsonschema:"Option indexes to select (0-based)"`
	TimeoutMS int      `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type SelectOptionOutput

type SelectOptionOutput struct {
	Message string `json:"message"`
}

type SelectTabInput

type SelectTabInput struct {
	Index *int   `json:"index,omitempty" jsonschema:"Tab index (0-based)"`
	ID    string `json:"id,omitempty" jsonschema:"Tab ID (from list_tabs)"`
}

SelectTabInput for switching to a specific tab.

type SelectTabOutput

type SelectTabOutput struct {
	Message string `json:"message"`
	URL     string `json:"url"`
	Title   string `json:"title"`
}

SelectTabOutput confirms the tab switch.

type SemanticSelector

type SemanticSelector struct {
	Role        string `json:"role,omitempty" jsonschema:"ARIA role (e.g. button, textbox, link)"`
	Text        string `json:"text,omitempty" jsonschema:"Element text content"`
	Label       string `json:"label,omitempty" jsonschema:"Associated label text"`
	Placeholder string `json:"placeholder,omitempty" jsonschema:"Input placeholder text"`
	TestID      string `json:"testid,omitempty" jsonschema:"data-testid attribute value"`
	Alt         string `json:"alt,omitempty" jsonschema:"Image alt text"`
	Title       string `json:"title,omitempty" jsonschema:"Element title attribute"`
	XPath       string `json:"xpath,omitempty" jsonschema:"XPath expression"`
	Near        string `json:"near,omitempty" jsonschema:"CSS selector of nearby element"`
}

SemanticSelector contains optional semantic selector fields for finding elements by accessibility attributes instead of just CSS selectors.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the W3Pilot MCP server.

func NewServer

func NewServer(config Config) *Server

NewServer creates a new MCP server.

func (*Server) Close

func (s *Server) Close(ctx context.Context) error

Close closes the server and browser session.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the MCP server.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session manages a browser session and collects test results.

func NewSession

func NewSession(config SessionConfig) *Session

NewSession creates a new Session.

func (*Session) ActiveContext

func (s *Session) ActiveContext() string

ActiveContext returns the active browsing context ID.

func (*Session) CaptureContext

func (s *Session) CaptureContext(ctx context.Context) *report.StepContext

CaptureContext captures the current page context.

func (*Session) CaptureScreenshot

func (s *Session) CaptureScreenshot(ctx context.Context) *report.ScreenshotRef

CaptureScreenshot captures a screenshot and returns a ScreenshotRef.

func (*Session) Close

func (s *Session) Close(ctx context.Context) error

Close closes the browser session.

func (*Session) FindSimilarSelectors

func (s *Session) FindSimilarSelectors(ctx context.Context, selector string) []string

FindSimilarSelectors attempts to find similar selectors to the given one.

func (*Session) GetTestResult

func (s *Session) GetTestResult() *report.TestResult

GetTestResult returns the current test result.

func (*Session) IsLaunched

func (s *Session) IsLaunched() bool

IsLaunched returns whether the browser has been launched.

func (*Session) LaunchIfNeeded

func (s *Session) LaunchIfNeeded(ctx context.Context) error

LaunchIfNeeded launches the browser if not already running.

func (*Session) NextStepID

func (s *Session) NextStepID(action string) string

NextStepID returns the next step ID.

func (*Session) Pilot

func (s *Session) Pilot(ctx context.Context) (*w3pilot.Pilot, error)

Pilot returns the browser controller, launching if needed. If an active context is set (via SetActiveContext), returns the page for that context.

func (*Session) RecordStep

func (s *Session) RecordStep(result report.StepResult)

RecordStep records a step result.

func (*Session) Recorder

func (s *Session) Recorder() *Recorder

Recorder returns the session's recorder.

func (*Session) Reset

func (s *Session) Reset()

Reset clears the session results.

func (*Session) SetActiveContext

func (s *Session) SetActiveContext(contextID string)

SetActiveContext sets the active browsing context ID for tab management.

func (*Session) SetPilot

func (s *Session) SetPilot(p *w3pilot.Pilot)

SetPilot sets the active Pilot instance (page or frame). This is used for frame selection.

func (*Session) SetTarget

func (s *Session) SetTarget(target string)

SetTarget sets the test target description.

type SessionConfig

type SessionConfig struct {
	Headless       bool
	DefaultTimeout time.Duration
	Project        string
	Target         string
	InitScripts    []string
}

SessionConfig holds session configuration.

type SessionStorageClearInput

type SessionStorageClearInput struct{}

SessionStorageClearInput for clearing all sessionStorage.

type SessionStorageClearOutput

type SessionStorageClearOutput struct {
	Message string `json:"message"`
}

SessionStorageClearOutput confirms the operation.

type SessionStorageDeleteInput

type SessionStorageDeleteInput struct {
	Key string `json:"key" jsonschema:"The key to remove from sessionStorage,required"`
}

SessionStorageDeleteInput for removing a sessionStorage item.

type SessionStorageDeleteOutput

type SessionStorageDeleteOutput struct {
	Message string `json:"message"`
}

SessionStorageDeleteOutput confirms the operation.

type SessionStorageGetInput

type SessionStorageGetInput struct {
	Key string `json:"key" jsonschema:"The key to get from sessionStorage,required"`
}

SessionStorageGetInput for getting a sessionStorage item.

type SessionStorageGetOutput

type SessionStorageGetOutput struct {
	Key   string  `json:"key"`
	Value *string `json:"value"` // null if key doesn't exist
}

SessionStorageGetOutput contains the retrieved value.

type SessionStorageListInput

type SessionStorageListInput struct{}

SessionStorageListInput for listing all sessionStorage items.

type SessionStorageListOutput

type SessionStorageListOutput struct {
	Items map[string]string `json:"items"`
	Count int               `json:"count"`
}

SessionStorageListOutput contains all sessionStorage items.

type SessionStorageSetInput

type SessionStorageSetInput struct {
	Key   string `json:"key" jsonschema:"The key to set in sessionStorage,required"`
	Value string `json:"value" jsonschema:"The value to store,required"`
}

SessionStorageSetInput for setting a sessionStorage item.

type SessionStorageSetOutput

type SessionStorageSetOutput struct {
	Message string `json:"message"`
}

SessionStorageSetOutput confirms the operation.

type SetContentInput

type SetContentInput struct {
	HTML string `json:"html" jsonschema:"HTML content to set,required"`
}

type SetContentOutput

type SetContentOutput struct {
	Message string `json:"message"`
}

type SetCookieInput

type SetCookieInput struct {
	Name     string  `json:"name"`
	Value    string  `json:"value"`
	URL      string  `json:"url,omitempty"`
	Domain   string  `json:"domain,omitempty"`
	Path     string  `json:"path,omitempty"`
	Expires  float64 `json:"expires,omitempty"`
	HTTPOnly bool    `json:"httpOnly,omitempty"`
	Secure   bool    `json:"secure,omitempty"`
	SameSite string  `json:"sameSite,omitempty"`
}

type SetCookiesInput

type SetCookiesInput struct {
	Cookies []SetCookieInput `json:"cookies" jsonschema:"Cookies to set,required"`
}

type SetCookiesOutput

type SetCookiesOutput struct {
	Message string `json:"message"`
}

type SetFilesInput

type SetFilesInput struct {
	Selector  string   `json:"selector" jsonschema:"CSS selector for the file input,required"`
	Files     []string `json:"files" jsonschema:"File paths to set,required"`
	TimeoutMS int      `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type SetFilesOutput

type SetFilesOutput struct {
	Message string `json:"message"`
}

type SetGeolocationInput

type SetGeolocationInput struct {
	Latitude  float64 `json:"latitude" jsonschema:"Latitude,required"`
	Longitude float64 `json:"longitude" jsonschema:"Longitude,required"`
	Accuracy  float64 `json:"accuracy" jsonschema:"Accuracy in meters"`
}

type SetGeolocationOutput

type SetGeolocationOutput struct {
	Message string `json:"message"`
}

type SetStorageStateInput

type SetStorageStateInput struct {
	State string `json:"state" jsonschema:"JSON from get_storage_state containing cookies, localStorage, and sessionStorage,required"`
}

type SetStorageStateOutput

type SetStorageStateOutput struct {
	Message string `json:"message"`
}

type SetTargetInput

type SetTargetInput struct {
	Target string `json:"target" jsonschema:"Test target description,required"`
}

type SetTargetOutput

type SetTargetOutput struct {
	Message string `json:"message"`
}

type SetViewportInput

type SetViewportInput struct {
	Width  int `json:"width" jsonschema:"Viewport width,required"`
	Height int `json:"height" jsonschema:"Viewport height,required"`
}

type SetViewportOutput

type SetViewportOutput struct {
	Message string `json:"message"`
}

type StartCoverageInput

type StartCoverageInput struct {
	JS        bool `json:"js" jsonschema:"Enable JavaScript coverage (default: true)"`
	CSS       bool `json:"css" jsonschema:"Enable CSS coverage (default: true)"`
	CallCount bool `json:"call_count" jsonschema:"Collect execution counts per block (default: true)"`
	Detailed  bool `json:"detailed" jsonschema:"Collect block-level coverage vs function-level (default: true)"`
}

type StartCoverageOutput

type StartCoverageOutput struct {
	Message string `json:"message"`
}

type StartRecordingInput

type StartRecordingInput struct {
	Name        string `json:"name,omitempty" jsonschema:"Name for the recorded script"`
	Description string `json:"description,omitempty" jsonschema:"Description of what the script tests"`
	BaseURL     string `json:"baseUrl,omitempty" jsonschema:"Base URL for relative URLs in the script"`
}

type StartRecordingOutput

type StartRecordingOutput struct {
	Message string `json:"message"`
}

type StartScreencastInput

type StartScreencastInput struct {
	Format        string `json:"format" jsonschema:"Image format: jpeg or png (default: jpeg),enum=jpeg,enum=png"`
	Quality       int    `json:"quality" jsonschema:"Image quality 0-100 for jpeg (default: 80)"`
	MaxWidth      int    `json:"max_width" jsonschema:"Maximum frame width in pixels (optional)"`
	MaxHeight     int    `json:"max_height" jsonschema:"Maximum frame height in pixels (optional)"`
	EveryNthFrame int    `json:"every_nth_frame" jsonschema:"Capture every Nth frame, 1=every frame (default: 1)"`
}

type StartScreencastOutput

type StartScreencastOutput struct {
	Message string `json:"message"`
}

type StartVideoInput

type StartVideoInput struct {
	Dir    string `json:"dir,omitempty" jsonschema:"Directory to save video to"`
	Width  int    `json:"width,omitempty" jsonschema:"Video width in pixels"`
	Height int    `json:"height,omitempty" jsonschema:"Video height in pixels"`
}

type StartVideoOutput

type StartVideoOutput struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

type StateDeleteInput

type StateDeleteInput struct {
	Name string `json:"name" jsonschema:"Name of the state snapshot to delete,required"`
}

type StateDeleteOutput

type StateDeleteOutput struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type StateListInput

type StateListInput struct{}

type StateListOutput

type StateListOutput struct {
	States []state.StateInfo `json:"states"`
	Count  int               `json:"count"`
}

type StateLoadInput

type StateLoadInput struct {
	Name string `json:"name" jsonschema:"Name of the state snapshot to load,required"`
}

type StateLoadOutput

type StateLoadOutput struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type StateSaveInput

type StateSaveInput struct {
	Name string `json:"name" jsonschema:"Name for the state snapshot (alphanumeric dash underscore),required"`
}

type StateSaveOutput

type StateSaveOutput struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type StopCoverageInput

type StopCoverageInput struct{}

type StopCoverageOutput

type StopCoverageOutput struct {
	Summary   CoverageSummaryOutput `json:"summary"`
	JSScripts int                   `json:"jsScripts"`
	CSSRules  int                   `json:"cssRules"`
	Message   string                `json:"message"`
}

type StopRecordingInput

type StopRecordingInput struct{}

type StopRecordingOutput

type StopRecordingOutput struct {
	Message   string `json:"message"`
	StepCount int    `json:"stepCount"`
}

type StopScreencastInput

type StopScreencastInput struct{}

type StopScreencastOutput

type StopScreencastOutput struct {
	Message string `json:"message"`
}

type StopVideoInput

type StopVideoInput struct{}

type StopVideoOutput

type StopVideoOutput struct {
	Path    string `json:"path"`
	Message string `json:"message"`
}

type TabInfo

type TabInfo struct {
	Index int    `json:"index"`
	ID    string `json:"id"`
	URL   string `json:"url"`
	Title string `json:"title"`
}

TabInfo contains information about a single tab.

type TakeHeapSnapshotInput

type TakeHeapSnapshotInput struct {
	Path string `json:"path" jsonschema:"File path to save snapshot (optional, auto-generated if empty)"`
}

type TakeHeapSnapshotOutput

type TakeHeapSnapshotOutput struct {
	Path    string `json:"path"`
	Size    int64  `json:"size"`
	SizeMB  string `json:"sizeMB"`
	Message string `json:"message"`
}

type TapInput

type TapInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type TapOutput

type TapOutput struct {
	Message string `json:"message"`
}

type ToolInfo

type ToolInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Category    string `json:"category"`
}

ToolInfo represents an MCP tool definition for export.

type ToolList

type ToolList struct {
	Tools      []ToolInfo     `json:"tools"`
	Categories map[string]int `json:"categories"`
	Total      int            `json:"total"`
}

ToolList represents the complete list of MCP tools.

func ListTools

func ListTools() *ToolList

ListTools returns the complete list of MCP tools with categories.

type TouchSwipeInput

type TouchSwipeInput struct {
	StartX float64 `json:"start_x" jsonschema:"Starting X coordinate,required"`
	StartY float64 `json:"start_y" jsonschema:"Starting Y coordinate,required"`
	EndX   float64 `json:"end_x" jsonschema:"Ending X coordinate,required"`
	EndY   float64 `json:"end_y" jsonschema:"Ending Y coordinate,required"`
}

type TouchSwipeOutput

type TouchSwipeOutput struct {
	Message string `json:"message"`
}

type TouchTapInput

type TouchTapInput struct {
	X float64 `json:"x" jsonschema:"X coordinate,required"`
	Y float64 `json:"y" jsonschema:"Y coordinate,required"`
}

type TouchTapOutput

type TouchTapOutput struct {
	Message string `json:"message"`
}

type TypeInput

type TypeInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the input element (can be empty if using semantic selectors)"`
	Text      string `json:"text" jsonschema:"Text to type,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
	SemanticSelector
}

type TypeOutput

type TypeOutput struct {
	Message string `json:"message"`
}

type UncheckInput

type UncheckInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the checkbox,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type UncheckOutput

type UncheckOutput struct {
	Message string `json:"message"`
}

type UninstallExtensionInput

type UninstallExtensionInput struct {
	ID string `json:"id" jsonschema:"Extension ID to uninstall,required"`
}

type UninstallExtensionOutput

type UninstallExtensionOutput struct {
	Message string `json:"message"`
}

type UnrouteInput

type UnrouteInput struct {
	Pattern string `json:"pattern" jsonschema:"URL pattern to unregister,required"`
}

type UnrouteOutput

type UnrouteOutput struct {
	Message string `json:"message"`
}

type ValidateSelectorsInput

type ValidateSelectorsInput struct {
	Selectors []string `json:"selectors" jsonschema:"List of CSS selectors to validate,required"`
}

type ValidateSelectorsOutput

type ValidateSelectorsOutput struct {
	Results []w3pilot.SelectorValidation `json:"results"`
	Summary ValidationSummary            `json:"summary"`
}

type ValidationSummary

type ValidationSummary struct {
	Total   int `json:"total"`
	Found   int `json:"found"`
	Missing int `json:"missing"`
	Visible int `json:"visible"`
}

type VerifyCheckedInput

type VerifyCheckedInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the checkbox/radio element,required"`
	Checked   bool   `json:"checked" jsonschema:"Expected checked state (default: true)"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyCheckedOutput

type VerifyCheckedOutput struct {
	Passed  bool   `json:"passed"`
	Checked bool   `json:"checked"`
	Message string `json:"message"`
}

type VerifyDisabledInput

type VerifyDisabledInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyDisabledOutput

type VerifyDisabledOutput struct {
	Passed  bool   `json:"passed"`
	Message string `json:"message"`
}

type VerifyEnabledInput

type VerifyEnabledInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyEnabledOutput

type VerifyEnabledOutput struct {
	Passed  bool   `json:"passed"`
	Message string `json:"message"`
}

type VerifyHiddenInput

type VerifyHiddenInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyHiddenOutput

type VerifyHiddenOutput struct {
	Passed  bool   `json:"passed"`
	Message string `json:"message"`
}

type VerifyListVisibleInput

type VerifyListVisibleInput struct {
	Items     []string `json:"items" jsonschema:"List of text items that should be visible on the page,required"`
	Selector  string   `json:"selector" jsonschema:"Optional CSS selector to scope the search"`
	TimeoutMS int      `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyListVisibleOutput

type VerifyListVisibleOutput struct {
	Passed  bool     `json:"passed"`
	Found   []string `json:"found"`
	Missing []string `json:"missing"`
	Message string   `json:"message"`
}

type VerifyTextInput

type VerifyTextInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	Expected  string `json:"expected" jsonschema:"Expected text content,required"`
	Exact     bool   `json:"exact" jsonschema:"Require exact match (default: false uses contains)"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyTextOutput

type VerifyTextOutput struct {
	Passed  bool   `json:"passed"`
	Actual  string `json:"actual"`
	Message string `json:"message"`
}

type VerifyValueInput

type VerifyValueInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the input element,required"`
	Expected  string `json:"expected" jsonschema:"Expected value to verify,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyValueOutput

type VerifyValueOutput struct {
	Passed  bool   `json:"passed"`
	Actual  string `json:"actual"`
	Message string `json:"message"`
}

type VerifyVisibleInput

type VerifyVisibleInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 5000)"`
}

type VerifyVisibleOutput

type VerifyVisibleOutput struct {
	Passed  bool   `json:"passed"`
	Message string `json:"message"`
}

type WaitForFunctionInput

type WaitForFunctionInput struct {
	Function  string `json:"function" jsonschema:"JavaScript function that returns truthy value,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 30000)"`
}

type WaitForFunctionOutput

type WaitForFunctionOutput struct {
	Message string `json:"message"`
}

type WaitForLoadInput

type WaitForLoadInput struct {
	State     string `` /* 129-byte string literal not displayed */
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 30000)"`
}

type WaitForLoadOutput

type WaitForLoadOutput struct {
	Message string `json:"message"`
}

type WaitForSelectorInput

type WaitForSelectorInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	State     string `` /* 149-byte string literal not displayed */
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 30000)"`
}

type WaitForSelectorOutput

type WaitForSelectorOutput struct {
	Message string `json:"message"`
}

type WaitForTextInput

type WaitForTextInput struct {
	Text      string `json:"text" jsonschema:"Text to wait for,required"`
	Selector  string `json:"selector,omitempty" jsonschema:"Optional selector to scope the search"`
	TimeoutMS int    `json:"timeout,omitempty" jsonschema:"Timeout in milliseconds (default 30000)"`
}

type WaitForTextOutput

type WaitForTextOutput struct {
	Message string `json:"message"`
}

type WaitForURLInput

type WaitForURLInput struct {
	Pattern   string `json:"pattern" jsonschema:"URL pattern to wait for,required"`
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 30000)"`
}

type WaitForURLOutput

type WaitForURLOutput struct {
	Message string `json:"message"`
}

type WaitUntilInput

type WaitUntilInput struct {
	Selector  string `json:"selector" jsonschema:"CSS selector for the element,required"`
	State     string `` /* 139-byte string literal not displayed */
	TimeoutMS int    `json:"timeout_ms" jsonschema:"Timeout in milliseconds (default: 30000)"`
}

type WaitUntilOutput

type WaitUntilOutput struct {
	Message string `json:"message"`
}

type WorkflowExtractTableInput

type WorkflowExtractTableInput struct {
	Selector       string `json:"selector" jsonschema:"CSS selector for the table element,required"`
	IncludeHeaders *bool  `json:"include_headers,omitempty" jsonschema:"Treat first row as headers (default true)"`
	MaxRows        int    `json:"max_rows,omitempty" jsonschema:"Maximum number of rows to extract (default 1000)"`
	HeaderSelector string `json:"header_selector,omitempty" jsonschema:"Custom selector for header cells (default: th)"`
	RowSelector    string `json:"row_selector,omitempty" jsonschema:"Custom selector for data rows (default: tbody tr)"`
	CellSelector   string `json:"cell_selector,omitempty" jsonschema:"Custom selector for cells (default: td)"`
}

type WorkflowExtractTableOutput

type WorkflowExtractTableOutput struct {
	Headers  []string            `json:"headers,omitempty"`
	Rows     [][]string          `json:"rows"`
	RowsJSON []map[string]string `json:"rows_json,omitempty"`
	RowCount int                 `json:"row_count"`
}

type WorkflowLoginInput

type WorkflowLoginInput struct {
	UsernameSelector string `json:"username_selector" jsonschema:"CSS selector for username/email field,required"`
	PasswordSelector string `json:"password_selector" jsonschema:"CSS selector for password field,required"`
	SubmitSelector   string `json:"submit_selector" jsonschema:"CSS selector for submit button,required"`
	Username         string `json:"username" jsonschema:"Username or email to enter,required"`
	Password         string `json:"password" jsonschema:"Password to enter,required"`
	SuccessIndicator string `json:"success_indicator,omitempty" jsonschema:"CSS selector or URL pattern indicating successful login"`
	TimeoutMS        int    `json:"timeout_ms,omitempty" jsonschema:"Timeout in milliseconds (default 30000)"`
}

type WorkflowLoginOutput

type WorkflowLoginOutput struct {
	Success     bool   `json:"success"`
	URL         string `json:"url"`
	Title       string `json:"title"`
	Message     string `json:"message"`
	ErrorReason string `json:"error_reason,omitempty"`
}

Directories

Path Synopsis
Package report provides test result tracking and report generation.
Package report provides test result tracking and report generation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL