Expand description
Portable Context Snapshot API
Normalizes arbitrary streams into ContextElements and merges them into a
point-in-time ContextSnapshot an agent can consume.
Re-exports§
pub use events::CelEvent;pub use watchdog::ContextWatchdog;
Modules§
- events
- CEL event types for the watchdog system.
- watchdog
- Context Watchdog — detects changes between context snapshots.
Structs§
- Audio
State - Generic audio output state.
- Bounds
- Screen-space rectangle in pixel coordinates.
- Bounds
Region - Coarse spatial region for resilient element targeting. Uses normalized coordinates (0.0-1.0) so references survive resolution changes.
- Clipboard
State - Generic clipboard state.
- Confidence
Thresholds - Confidence thresholds for agent behavior.
- Connection
Event - A raw TCP/UDP connection observed by any source.
- Context
Contribution - Generic source contribution accepted by
ContextMerger. - Context
Element - A single UI element in the unified context model.
- Context
Merger - Generic merger for already-normalized context contributions.
- Context
Reference - A resilient, multi-signal reference to a UI element. Unlike element IDs (which are ephemeral per snapshot), references survive across context snapshots by combining multiple identifying signals.
- Context
Snapshot - A point-in-time context snapshot built from normalized stream facts.
- Element
State - UI element state flags.
- Focused
Context - High-fidelity context for a single element — the “zoom in” view.
- Http
Event - A real HTTP request/response observed by CDP, proxy, or another source.
- Power
State - Generic battery / power state.
- Recent
File - Generic recent file state.
- Running
App - Generic running app state.
- Stream
Status - High-level status for streams that contributed to a context snapshot.
- Transcript
Entry - A single transcribed speech segment from the audio capture layer. Source-agnostic: may come from the microphone or system loopback.
- Window
State - Generic visible-window state.
Enums§
- Confidence
Behavior - What behavior the agent should exhibit given a confidence score.
- Content
Role - Content role classification for prompt injection defense.
- Context
Source - The source that provided a context element.
Functions§
- aria_
role_ to_ cel_ type - Convert a WAI-ARIA / DOM role into CEL’s normalized element type strings.
- assign_
default_ actions - build_
from_ external - classify_
content_ role - Classify an element’s content role based on its type and properties.
- is_
actionable_ type - resolve_
reference - Resolve a reference against a screen context snapshot. Returns the best-matching element if its score exceeds the threshold.
- score_
element_ confidence