agent-desktop/crates/core/src/lib.rs
Lahfir b13dc69afd feat: implement progressive skeleton traversal with ref-rooted drill-down
Add --skeleton and --root flags to snapshot command for token-efficient
accessibility tree exploration. Skeleton mode clamps depth to 3 levels
and annotates truncated containers with children_count, allowing AI
agents to discover regions before drilling into them. Named containers
at skeleton boundaries (via name or description) receive refs as
drill-down targets. The --root flag starts traversal from a previous
ref with scoped invalidation — only refs from that drill-down are
replaced on re-drill.

Key changes:
- New ref_alloc.rs: shared ref helpers (INTERACTIVE_ROLES, actions_for_role,
  ref_entry_from_node, is_collapsible) extracted from snapshot.rs
- New snapshot_ref.rs: drill-down logic with DrillDownConfig, scoped
  invalidation via root_ref tagging on RefEntry
- macOS count_children() uses raw CFArrayGetCount without materializing
  AXElement wrappers for performance at skeleton boundaries
- RefMap write-side size check prevents >1MB files
- Skeleton anchors consider both name and description for Electron compat
2026-03-10 02:28:23 -07:00

26 lines
802 B
Rust

pub mod action;
pub mod adapter;
pub mod commands;
pub mod error;
pub mod hints;
pub mod node;
pub mod notification;
pub mod output;
pub mod ref_alloc;
pub mod refs;
pub mod snapshot;
pub mod snapshot_ref;
pub use action::{
Action, ActionResult, Direction, DragParams, ElementState, KeyCombo, Modifier, MouseButton,
MouseEvent, MouseEventKind, Point, WindowOp,
};
pub use adapter::{
ImageBuffer, ImageFormat, NativeHandle, PermissionStatus, PlatformAdapter, ScreenshotTarget,
TreeOptions, WindowFilter,
};
pub use error::{AdapterError, AppError, ErrorCode};
pub use node::{AccessibilityNode, AppInfo, Rect, WindowInfo};
pub use notification::{NotificationFilter, NotificationInfo};
pub use output::{AppContext, ErrorPayload, Response, WindowContext};
pub use refs::{RefEntry, RefMap};