adapter

package
v0.0.0-...-ce06b13 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package adapter defines the common interface and shared types for all browsertools evidence importers.

Each adapter (playwright, llmscraper, crawl4ai, firecrawl) implements the Adapter interface, accepting saved fixture data and emitting normalized evidence.Record values. No adapter may contact live browsers or network services in its default code path; all imports operate on in-memory or on-disk fixture data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalFixtureOrigin

func CanonicalFixtureOrigin(adapterName, fixtureURL, expectedOrigin string) (string, error)

CanonicalFixtureOrigin verifies that a saved adapter fixture declares a URL whose canonical origin exactly matches the caller-provided allowlist origin, then returns that canonical origin for use in emitted evidence.

func ValidateFixtureOrigin

func ValidateFixtureOrigin(adapterName, fixtureURL, expectedOrigin string) error

ValidateFixtureOrigin verifies that a saved adapter fixture declares a URL whose canonical origin exactly matches the caller-provided allowlist origin. CanonicalFixtureOrigin should be used by importers that emit evidence.

Types

type Adapter

type Adapter interface {
	// Name returns the human-readable tool name (e.g. "playwright").
	Name() string
	// Import converts raw tool output bytes into normalized evidence records.
	// The caller must have already reviewed the raw bytes for secrets; Import
	// sets RedactionStatus based on the options supplied.
	Import(raw []byte, opts Options) ([]evidence.Record, error)
}

Adapter is implemented by each tool-specific evidence importer.

type Options

type Options struct {
	// Origin is the allowed browser origin (scheme+host) for all produced records.
	// Importers emit its canonical spelling. Required.
	Origin string
	// ActionHint is the action name to record on all produced records.
	// Optional; leave empty if the fixture covers multiple actions.
	ActionHint string
	// RedactionStatus must be set by the caller to indicate whether sensitive
	// fields have been reviewed (evidence.RedactionNotRequired or
	// evidence.RedactionCompleted).
	// It has no implicit default, including for synthetic fixtures.
	RedactionStatus evidence.RedactionStatus
	// RedactedFields lists any fields replaced by "[REDACTED]" markers.
	// Required when RedactionStatus is evidence.RedactionCompleted.
	RedactedFields []string
}

Options controls how an adapter normalizes raw input.

Directories

Path Synopsis
Package crawl4ai imports Crawl4AI crawl/scrape/extraction output as evidence.
Package crawl4ai imports Crawl4AI crawl/scrape/extraction output as evidence.
Package firecrawl imports Firecrawl scrape/crawl/map/extract/interact output as candidate evidence.
Package firecrawl imports Firecrawl scrape/crawl/map/extract/interact output as candidate evidence.
Package llmscraper imports llm-scraper structured-extraction output as candidate output evidence.
Package llmscraper imports llm-scraper structured-extraction output as candidate output evidence.
Package playwright imports Playwright accessibility-snapshot and action-probe fixtures as normalized evidence records.
Package playwright imports Playwright accessibility-snapshot and action-probe fixtures as normalized evidence records.

Jump to

Keyboard shortcuts

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