Versions in this module Expand all Collapse all v0 v0.8.0 Nov 14, 2026 v0.7.0 Nov 5, 2026 v0.6.0 Oct 3, 2026 v0.5.0 Sep 28, 2026 v0.4.0 Sep 16, 2026 v0.3.0 Aug 1, 2026 v0.2.0 Jul 30, 2026 Changes in this version + const AnyMutation + const MaxActionsInPrompt + const MaxFailedElements + const MaxPlannerOutputTokens + const MaxRevisitsPerURL + const SingleCred + var ErrNoModel = errors.New("hackbrowser: no LLM provider configured for the planner") + var Log = newLogState() + func AutoLogin(ctx context.Context, sess *browser.Session, creds LoginCredentials) error + func AvailabilityToRecord(availability map[string][]string) map[string][]string + func BuildRawRequest(method, rawURL string, headers map[string]string, body string) string + func ClassifyAuthURL(rawURL string) string + func ComputeElementAvailability(elementsByContext map[string][]RawElement) map[string][]string + func DeriveScope(targetURL string) string + func DrainEmptyStateQueue(state *GlobalState, credID string) []string + func DrainOnMutation(state *GlobalState, credID, taskMutation string) []string + func ExpandDisclosures(ctx context.Context, sess *browser.Session) + func GenerateFingerprint(elements []RawElement) string + func GenerateFullFingerprint(elements []RawElement) string + func Handle2FA(ctx context.Context, sess *browser.Session) bool + func Handle2FAWithPrompt(ctx context.Context, sess *browser.Session, prompt PromptFunc) bool + func HasSuccessfulMutation(httpRequests []string) bool + func IsViewportCenterBlocked(ctx context.Context, sess *browser.Session) bool + func LoadSession(ctx context.Context, sess *browser.Session, filePath string) (bool, error) + func MarkPageEmpty(state *GlobalState, credID, pageURL, expectedMutation string) bool + func NormalizeScope(input string) string + func NormalizeURL(rawURL string) string + func ParseRequestParams(body, rawURL string) map[string]string + func RecordAction(page *PageState, elementID, action, value string, result ActionResult) + func RevealLazyContent(ctx context.Context, sess *browser.Session) + func SaveSession(ctx context.Context, sess *browser.Session, filePath string, urls []string) error + type ActionRecord struct + Action string + ElementID string + HTTPSideEffects []string + Success bool + Value string + type ActionResult struct + DOMChanged bool + Error string + HTTPRequests []string + Navigated bool + NewURL string + Success bool + type Agent struct + Cred string + Done <-chan struct{} + EventSink func(CSEvent) + Executor *Executor + Global *GlobalState + Planner *LLMPlanner + Scope ScopeMatcher + Sess *browser.Session + Sink func(CapturedRequest) + Usage *CrawlUsage + func (a *Agent) Crawl(ctx context.Context, startURL string, maxSteps int) []string + type AuthPhase string + const AuthAnonymous + const AuthAuthenticated + const AuthRegistered + type CSEvent struct + CapturedEndpoints int + Credential string + Credentials []string + Elements int + From string + IsMutation bool + Kind string + MaxPages int + Method string + Mutation bool + Mutations int + Note string + OK bool + PageNum int + PageState PageStateKind + PagesExplored int + Path string + Reason string + StartedAt time.Time + Status int + Summary []EventSummary + Target string + TargetLabel string + Tasks int + To string + Trigger string + Type string + URL string + Value string + type CapturedRequest struct + ElementRoles []string + PageURL string + PageVisitedBy []string + Raw string + Response *CapturedResponse + Scheme string + Timestamp time.Time + TriggerElement string + UIContext *UIContext + type CapturedResponse struct + Body string + Headers map[string]string + Status int + type ClickPointProbe struct + Occluder *OccluderInfo + Status string + func ProbeClickPoint(ctx context.Context, sess *browser.Session, selector string) ClickPointProbe + type ClickTask struct + Label string + Reason string + Role string + TriggersMutation string + Type string + type ConfirmFunc func() + func WaitForManualLogin(ctx context.Context, sess *browser.Session, req ManualLoginRequest) (ConfirmFunc, <-chan struct{}) + type CrawlOptions struct + Authenticated bool + CredentialID string + Credentials *LoginCredentials + Done <-chan struct{} + DryRun bool + EventSink func(event CSEvent) + Exclude []string + Headless bool + LogLevel string + MultiCredentials []CredentialConfig + Scope []string + SessionFile string + SessionID string + Steps int + URL string + type CrawlResult struct + CapturedEndpoints int + Errors []string + PagesExplored int + SessionID string + TotalSteps int + Usage CrawlUsage + func RunCrawl(ctx context.Context, opts CrawlOptions, model llm.Client) (CrawlResult, error) + type CrawlUsage struct + CacheReadTokens int + CacheWriteTokens int + InputTokens int + OutputTokens int + type CredentialConfig struct + ID string + type DeferredAuthPage struct + Type string + URL string + type EventSummary struct + Kind string + Label string + type Executor struct + Sess *browser.Session + func (e *Executor) ExecuteTask(ctx context.Context, task PageTask, elements []RawElement) ActionResult + type FormFieldPlan struct + Label string + Role string + Value string + type FormSubmitRef struct + Label string + Role string + type FormTask struct + Fields []FormFieldPlan + Submit FormSubmitRef + TriggersMutation string + Type string + type GlobalState struct + AuthPhase AuthPhase + CapturedPaths map[string]bool + DeferredAuth []DeferredAuthPage + IntelligenceByCredential map[string]*IntelligenceState + OutOfScope []string + PageQueue []string + PathPatternCount map[string]int + PendingReDiscovery bool + TotalSteps int + VisitedPages map[string]bool + func CreateGlobalState(outOfScope []string) *GlobalState + type IntelligenceState struct + EmptyStateQueue map[string]string + PageFingerprints map[string]string + RevisitCount map[string]int + func GetIntelligence(state *GlobalState, credID string) *IntelligenceState + type LLMPlanner struct + Model llm.Client + Usage *CrawlUsage + func (p *LLMPlanner) Plan(ctx context.Context, snapshot PlannerSnapshot) (PagePlan, error) + func (p *LLMPlanner) PlanUnexplored(ctx context.Context, snapshot PlannerSnapshot, unexplored []string) (PagePlan, error) + type LogExtra struct + Key string + Value any + func F(key string, value any) LogExtra + type LogLevel string + const LevelDebug + const LevelError + const LevelInfo + const LevelWarn + type LogRecord struct + Extra map[string]any + Level LogLevel + Message string + Service string + Timestamp time.Time + type LogSink func(record LogRecord) + type Logger interface + Debug func(message string, extra ...LogExtra) + Error func(message string, extra ...LogExtra) + Info func(message string, extra ...LogExtra) + Warn func(message string, extra ...LogExtra) + type LoginCredentials struct + Password string + PasswordSelector string + Username string + UsernameSelector string + type ManualLoginRequest struct + Label string + Step int + Total int + URL string + type OccluderInfo struct + Role string + Tag string + Text string + type OcclusionSignal struct + Label string + OccluderText string + Role string + type OcclusionState struct + Pending []OcclusionSignal + Signaled map[string]bool + type PagePlan struct + PageState PageStateKind + RevisitAfter string + RevisitOn string + RevisitReason string + Tasks []PageTask + type PageState struct + ActionsThisPage []ActionRecord + CurrentURL string + Elements []RawElement + FailedElementIDs map[string]bool + LastActionResult *ActionResult + Step int + ViewportCenterBlocked bool + func CreatePageState(url string) *PageState + type PageStateKind string + const PageStateEmpty + const PageStatePopulated + const PageStateUnknown + type PageTask struct + Fields []FormFieldPlan + Label string + Reason string + Role string + Submit *FormSubmitRef + TriggersMutation string + Type string + type Planner interface + Plan func(ctx context.Context, snapshot PlannerSnapshot) (PagePlan, error) + type PlannerSnapshot struct + Elements []PromptElement + OutOfScope []string + PendingMutations []string + TotalPagesVisited int + URL string + ViewportCenterBlocked bool + func BuildPlannerSnapshot(pageURL string, elements []RawElement, state *GlobalState, credID string, ...) PlannerSnapshot + type PromptElement struct + Constraints string + Enabled *bool + Href string + ID string + Label string + OccludedBy string + Options string + Placeholder string + Role string + Type string + Value string + type PromptFunc func(ctx context.Context, prompt string) (string, error) + type PromptPayload struct + Elements []PromptElement + FailedElements []string + LastAction *ActionRecord + RecentActions []ActionRecord + TotalPagesVisited int + URL string + UnvisitedLinksOnPage int + ViewportCenterBlocked bool + func BuildPromptPayload(page *PageState, state *GlobalState) PromptPayload + type RawElement struct + Constraints string + Enabled bool + Href string + ID string + InChrome bool + Label string + Options string + Placeholder string + Role string + Selector string + Tag string + Type string + Value string + func CollectElements(ctx context.Context, sess *browser.Session) ([]RawElement, error) + func FilterVisitedLinks(elements []RawElement, currentURL string, visited map[string]bool) []RawElement + func FindElement(page *PageState, elementID string) *RawElement + type ScopeMatcher func(host string) bool + func MakeMatcher(scopes []string) ScopeMatcher + type SessionFile struct + Cookies []browser.Cookie + SavedAt time.Time + type UIContext struct + ComponentPath string + Fields []UIField + FormName string + HiddenParams []string + PageTitle string + PageURL string + func CorrelateWithUI(ui *UIContext, requestParams map[string]string) *UIContext + func SnapshotPageUI(ctx context.Context, sess *browser.Session, triggerSel, componentPath string) (*UIContext, error) + type UIField struct + HiddenReason string + IsDisabled bool + IsDisplayOnly bool + IsHidden bool + IsReadOnly bool + Label string + Name string + Options string + Type string + Validation struct{ ... } + Value string v0.1.0 Jul 29, 2026