teksilo-automation 0.9.4

GUI-free runtime-introspection & automation toolkit for Teksilo apps (semantic tree + AT-action driving over serde DTOs).
Documentation
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 FernTech

//! # teksilo-automation
//!
//! GUI-free runtime-introspection & automation toolkit for Teksilo apps.
//!
//! A Teksilo app exposes a rich semantic surface — the AccessKit
//! accessibility tree — plus an AT-action dispatch path, both of which are
//! queryable and drivable **in-process, without the OS accessibility
//! layer**. This crate turns that latent capability into a small set of
//! serde DTOs plus one core function, [`execute`], that an MCP server (or
//! any other harness) marshals operations to.
//!
//! ```text
//! execute(tree: &mut WidgetTree, ops: &mut dyn WindowOps,
//!         op: &AutomationOp, settle: &SettleSpec) -> AutomationReply
//! ```
//!
//! The wire protocol is **serde DTOs, never closures or `!Send` handles**
//! ([`dto`]). [`WidgetTree`](teksilo_core::WidgetTree) is `!Send`, so it
//! lives on exactly one thread; async / socket layers marshal `Send` DTOs
//! to it. Two operations need context [`execute`] doesn't hold —
//! `list_windows` (the window manager) and `screenshot` (a GPU / platform
//! window) — and return [`dto::codes::HOST_REQUIRED`]; the headless server
//! and the live bridge serve those themselves.
//!
//! This crate has no GUI, render, platform, or async dependency. It mirrors
//! `teksilo-data`'s "core-only peer" design so a CI harness, a headless
//! test, or the live in-app bridge can all share it.
//!
//! ## Modules
//! - [`dto`] — the serde wire protocol.
//! - [`executor`] — [`execute`] and the settle model.
//! - [`recording_ops`] — a non-panicking [`WindowOps`](teksilo_core::WindowOps)
//!   for the headless server.
//! - [`mcp_schema`] — the canonical tool catalog.
//! - [`wire`] — the live-bridge framing, token handshake and endpoint
//!   discovery, shared verbatim by the in-app bridge and the MCP client.

pub mod dto;
pub mod executor;
pub mod mcp_schema;
pub mod recording_ops;
pub mod wire;

pub use dto::{
    AnnouncementDto, Assertion, AssertionResult, AutomationOp, AutomationReply, AutomationRequest,
    LayoutNode, NodeBounds, NodeRef, PointerAction, PointerButtonDto, ScreenshotMeta, SemanticNode,
    SettleSpec, ShortcutInfo, WaitCondition, WindowInfo, codes,
};
pub use executor::{execute, run_settle};
pub use mcp_schema::{TOOL_CATALOG, TOOL_COUNT, ToolDescriptor};
pub use recording_ops::{RecordedWindow, RecordingWindowOps};
pub use wire::{Endpoint, EndpointFile, Transport};

#[cfg(test)]
mod tests;