Documentation
¶
Overview ¶
Package research implements the Observer and Researcher exploration roles: capturing one settled screen of the app through the device driver and turning that capture into a validated UI map for planning and testing conversations.
Index ¶
Constants ¶
const DefaultSettleTimeout = 5 * time.Second
DefaultSettleTimeout bounds the settle wait when the caller sets none.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Get(screen explore.ScreenSignature) (*explore.UIMap, bool)
Put(screen explore.ScreenSignature, m *explore.UIMap)
}
Cache stores researched UI maps by screen. Nil on the Researcher disables caching.
type Observer ¶
type Observer struct {
Driver device.Driver
AppID string
// SettleTimeout bounds the static-screen wait; zero means
// DefaultSettleTimeout.
SettleTimeout time.Duration
// Logf receives observation notes, such as an unsettled screen
// being captured anyway. Nil is silent.
Logf func(format string, args ...any)
// Clock supplies capture timestamps; nil means wall time.
Clock func() time.Time
}
Observer captures the current screen of one application. It settles the screen within a bound, reads the hierarchy scoped to the app, takes an uncompressed screenshot, and derives flattened elements plus the screen signature.
type Researcher ¶
type Researcher struct {
Models explore.ModelSet
// Cache short-circuits research for screens already mapped.
Cache Cache
// Clock supplies map timestamps; nil means wall time.
Clock func() time.Time
}
Researcher turns an observed screen into a validated UI map. One worker call proposes sections over the element table; unknown element indexes get exactly one correction round in the same conversation; locators are assigned deterministically from the flattened tree; an optional vision call adds per-element visual notes.
func (*Researcher) Research ¶
func (r *Researcher) Research(ctx context.Context, state *explore.ScreenState) (*explore.UIMap, error)
Research maps one screen. The input state is never mutated.